SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::view_translate_single< urng_t > Class Template Reference

The return type of seqan3::views::translate_single. More...

#include <seqan3/alphabet/views/translate.hpp>

+ Inheritance diagram for seqan3::detail::view_translate_single< urng_t >:

Public Types

Member types
using reference = aa27
 The reference_type.
 
using const_reference = aa27
 The const_reference type.
 
using value_type = aa27
 The value_type (which equals the reference_type with any references removed).
 
using size_type = std::ranges::range_size_t< urng_t >
 The size_type.
 
using difference_type = std::ranges::range_difference_t< urng_t >
 A signed integer type, usually std::ptrdiff_t.
 
using iterator = detail::random_access_iterator< view_translate_single >
 The iterator type of this view (a random access iterator).
 
using const_iterator = detail::random_access_iterator< view_translate_single const >
 The const_iterator type is equal to the iterator type.
 

Public Member Functions

size_type size ()
 Returns the number of elements in the view.
 
size_type size () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Constructors, destructor and assignment
 view_translate_single () noexcept=default
 Defaulted.
 
constexpr view_translate_single (view_translate_single const &rhs) noexcept=default
 Defaulted.
 
constexpr view_translate_single (view_translate_single &&rhs) noexcept=default
 Defaulted.
 
constexpr view_translate_singleoperator= (view_translate_single const &rhs) noexcept=default
 Defaulted.
 
constexpr view_translate_singleoperator= (view_translate_single &&rhs) noexcept=default
 Defaulted.
 
 ~view_translate_single () noexcept=default
 Defaulted.
 
 view_translate_single (urng_t _urange, translation_frames const _tf=translation_frames::forward_frame0)
 Construct from another view.
 
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, view_translate_single>) && std::ranges::viewable_range<rng_t> && std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
 view_translate_single (rng_t &&_urange, translation_frames const _tf=translation_frames::forward_frame0)
 Construct from another range.
 
Iterators
iterator begin () noexcept
 Returns an iterator to the first element of the container.
 
const_iterator begin () const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
iterator end () noexcept
 Returns an iterator to the element following the last element of the container.
 
const_iterator end () const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Element access
reference operator[] (size_type const n)
 Return the n-th element.
 
const_reference operator[] (size_type const n) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Private Attributes

translation_frames tf
 The frame that should be used for translation.
 
urng_t urange
 The input range (of ranges).
 

Static Private Attributes

static constexpr small_string multiple_frame_error
 Error thrown if tried to be used with multiple frames.
 

Detailed Description

template<std::ranges::view urng_t>
requires std::ranges::sized_range<urng_t> && std::ranges::random_access_range<urng_t> && nucleotide_alphabet<std::ranges::range_reference_t<urng_t>>
class seqan3::detail::view_translate_single< urng_t >

The return type of seqan3::views::translate_single.

Constructor & Destructor Documentation

◆ view_translate_single() [1/2]

template<std::ranges::view urng_t>
seqan3::detail::view_translate_single< urng_t >::view_translate_single ( urng_t  _urange,
translation_frames const  _tf = translation_frames::forward_frame0 
)
inline

Construct from another view.

Parameters
[in]_urangeThe underlying range.
[in]_tfThe frame that should be used for translation.

Exceptions

Throws if multiple frames are given as _tf input argument.

◆ view_translate_single() [2/2]

template<std::ranges::view urng_t>
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, view_translate_single>) && std::ranges::viewable_range<rng_t> && std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
seqan3::detail::view_translate_single< urng_t >::view_translate_single ( rng_t &&  _urange,
translation_frames const  _tf = translation_frames::forward_frame0 
)
inline

Construct from another range.

Parameters
[in]_urangeThe underlying range.
[in]_tfThe frame that should be used for translation.

Exceptions

Throws if multiple frames are given as _tf input argument.

Member Function Documentation

◆ begin()

template<std::ranges::view urng_t>
iterator seqan3::detail::view_translate_single< urng_t >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end()

template<std::ranges::view urng_t>
iterator seqan3::detail::view_translate_single< urng_t >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ operator[]()

template<std::ranges::view urng_t>
reference seqan3::detail::view_translate_single< urng_t >::operator[] ( size_type const  n)
inline

Return the n-th element.

Parameters
[in]nThe element to retrieve.
Returns
Either a writable proxy to the element or a copy (if called in const context).

Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container.

Exceptions

Strong exception guarantee (never modifies data).

Complexity

Constant.

◆ size()

template<std::ranges::view urng_t>
size_type seqan3::detail::view_translate_single< urng_t >::size ( )
inline

Returns the number of elements in the view.

Returns
The number of elements in the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

Member Data Documentation

◆ multiple_frame_error

template<std::ranges::view urng_t>
constexpr small_string seqan3::detail::view_translate_single< urng_t >::multiple_frame_error
staticconstexprprivate
Initial value:
{"Error: Invalid type of frame. Choose one out of "
"forward_frame0, reverse_frame0, forward_frame1, "
"reverse_frame1, forward_frame2 and reverse_frame2."}

Error thrown if tried to be used with multiple frames.


The documentation for this class was generated from the following file:
Hide me