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

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

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

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

Public Types

Member types
using reference = view_translate_single< urng_t >
 The reference_type.
 
using const_reference = reference
 The const_reference type.
 
using value_type = reference
 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 >
 The iterator type of this view (a random access iterator).
 
using const_iterator = detail::random_access_iterator< view_translate const >
 The const iterator type of this view (same as iterator, because it's a view).
 

Public Member Functions

Constructors, destructor and assignment
 view_translate () noexcept=default
 Defaulted.
 
constexpr view_translate (view_translate const &rhs) noexcept=default
 Defaulted.
 
constexpr view_translate (view_translate &&rhs) noexcept=default
 Defaulted.
 
constexpr view_translateoperator= (view_translate const &rhs) noexcept=default
 Defaulted.
 
constexpr view_translateoperator= (view_translate &&rhs) noexcept=default
 Defaulted.
 
 ~view_translate () noexcept=default
 Defaulted.
 
 view_translate (urng_t _urange, translation_frames const _tf=translation_frames::six_frames)
 Construct from another view.
 
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, view_translate>) && std::ranges::viewable_range<rng_t> && std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
 view_translate (rng_t &&_urange, translation_frames const _tf)
 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.
 
size_type size () noexcept
 Returns the number of elements in the view.
 
size_type size () 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

small_vector< translation_frames, 6 > selected_frames {}
 The selected frames corresponding to the frames required.
 
translation_frames tf
 The frames that should be used for translation.
 
urng_t urange
 The data members of view_translate_single.
 

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< urng_t >

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

Template Parameters
urng_tThe type of the range being translated.
Parameters
[in]tfTranslation frames to be used.

Constructor & Destructor Documentation

◆ view_translate() [1/2]

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

Construct from another view.

Parameters
[in]_urangeThe underlying range (of ranges).
[in]_tfThe frames that should be used for translation.

◆ view_translate() [2/2]

template<std::ranges::view urng_t>
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, view_translate>) && 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< urng_t >::view_translate ( rng_t &&  _urange,
translation_frames const  _tf 
)
inline

Construct from another range.

Parameters
[in]_urangeThe underlying range (of ranges).
[in]_tfThe frames that should be used for translation.

Member Function Documentation

◆ begin()

template<std::ranges::view urng_t>
iterator seqan3::detail::view_translate< 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< 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< 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< urng_t >::size ( )
inlinenoexcept

Returns the number of elements in the view.

Returns
The number of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.


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