The CRTP base for a combined alphabet that contains multiple values of different alphabets at the same time. More...
#include <seqan3/alphabet/composition/cartesian_composition.hpp>
Public Types | |
using | rank_type = detail::min_viable_uint_t< size - 1 > |
The type of the alphabet when represented as a number (e.g. via to_rank()). | |
Member types | |
using | char_type = void |
The type of the alphabet when converted to char (e.g. via to_char()). | |
Public Member Functions | |
Comparison operators (against indirect component_list) | |
| |
template<typename indirect_component_type > | |
constexpr bool | operator== (indirect_component_type const &rhs) const noexcept |
template<typename indirect_component_type > | |
constexpr bool | operator!= (indirect_component_type const &rhs) const noexcept |
template<typename indirect_component_type > | |
constexpr bool | operator< (indirect_component_type const &rhs) const noexcept |
template<typename indirect_component_type > | |
constexpr bool | operator> (indirect_component_type const &rhs) const noexcept |
template<typename indirect_component_type > | |
constexpr bool | operator<= (indirect_component_type const &rhs) const noexcept |
template<typename indirect_component_type > | |
constexpr bool | operator>= (indirect_component_type const &rhs) const noexcept |
Read functions | |
constexpr char_type | to_char () const noexcept |
Return the letter as a character of char_type. More... | |
constexpr rank_type | to_rank () const noexcept |
Return the letter's numeric value (rank in the alphabet). More... | |
Write functions | |
constexpr derived_type & | assign_char (std::conditional_t< std::Same< char_type, void >, char, char_type > const c) noexcept |
Assign from a character. More... | |
constexpr derived_type & | assign_rank (rank_type const c) noexcept |
Assign from a numeric value. More... | |
Static Public Attributes | |
static detail::min_viable_uint_t< size > constexpr | value_size |
The size of the alphabet, i.e. the number of different values it can take. | |
Related Functions | |
(Note that these are not member functions.) | |
Comparison operators | |
Free function (in-)equality comparison operators that forward to member operators (for types != self). | |
template<typename indirect_component_type , typename derived_type , typename ... component_types> | |
constexpr bool | operator== (indirect_component_type const &lhs, cartesian_composition< derived_type, component_types... > const &rhs) |
template<typename indirect_component_type , typename derived_type , typename ... indirect_component_types> | |
constexpr bool | operator!= (indirect_component_type const &lhs, cartesian_composition< derived_type, indirect_component_types... > const &rhs) |
template<typename indirect_component_type , typename derived_type , typename ... indirect_component_types> | |
constexpr bool | operator< (indirect_component_type const &lhs, cartesian_composition< derived_type, indirect_component_types... > const &rhs) |
template<typename indirect_component_type , typename derived_type , typename ... indirect_component_types> | |
constexpr bool | operator> (indirect_component_type const &lhs, cartesian_composition< derived_type, indirect_component_types... > const &rhs) |
template<typename indirect_component_type , typename derived_type , typename ... indirect_component_types> | |
constexpr bool | operator<= (indirect_component_type const &lhs, cartesian_composition< derived_type, indirect_component_types... > const &rhs) |
template<typename indirect_component_type , typename derived_type , typename ... indirect_component_types> | |
constexpr bool | operator>= (indirect_component_type const &lhs, cartesian_composition< derived_type, indirect_component_types... > const &rhs) |
Requirements for seqan3::semi_alphabet_concept | |
You can expect these functions on all types that implement seqan3::semi_alphabet_concept. | |
template<typename semi_alphabet_type > | |
using | underlying_rank_t = typename underlying_rank< semi_alphabet_type >::type |
The rank_type of the semi_alphabet. [type metafunction shortcut]. More... | |
template<typename alphabet_type > | |
constexpr auto | alphabet_size_v = alphabet_size<alphabet_type>::value |
The size of the alphabet. [value metafunction shortcut]. More... | |
rank_type | to_rank (semi_alphabet_concept const alph) |
Returns the alphabet letter's value in rank representation. More... | |
semi_alphabet_concept && | assign_rank (semi_alphabet_concept &&alph, rank_type const rank) |
Returns the alphabet letter's value in rank representation. More... | |
Requirements for std::Swappable | |
You can expect these functions on all types that implement std::Swappable. | |
void | swap (t &lhs, t &rhs) |
Swaps the contents of two objects. More... | |
Requirements for std::EqualityComparable | |
You can expect these functions on all types that implement std::Equality_comparable. | |
bool | operator== (type const &lhs, type const &rhs) |
(In-)Equality comparison. More... | |
bool | operator!= (type const &lhs, type const &rhs) |
(In-)Equality comparison. More... | |
Requirements for std::StrictTotallyOrdered | |
You can expect these functions on all types that implement std::StrictTotallyOrdered. | |
bool | operator< (type const &lhs, type const &rhs) |
Less-than, greater-than and -or-equal comparisons. More... | |
bool | operator<= (type const &lhs, type const &rhs) |
Less-than, greater-than and -or-equal comparisons. More... | |
bool | operator> (type const &lhs, type const &rhs) |
Less-than, greater-than and -or-equal comparisons. More... | |
bool | operator>= (type const &lhs, type const &rhs) |
Less-than, greater-than and -or-equal comparisons. More... | |
Constructors, destructor and assignment | |
| |
constexpr | cartesian_composition (component_types ... components) |
Construction from initialiser-list. | |
template<typename component_type > | |
constexpr | cartesian_composition (component_type const alph) |
Construction via a value of one of the components. More... | |
template<typename indirect_component_type > | |
constexpr | cartesian_composition (indirect_component_type const alph) |
Construction via a value of a subtype that is assignable to one of the components. More... | |
template<typename component_type > | |
constexpr derived_type & | operator= (component_type const alph) |
Assignment via a value of one of the components. More... | |
template<typename indirect_component_type > | |
constexpr derived_type & | operator= (indirect_component_type const alph) |
Assignment via a value of a subtype that is assignable to one of the components. More... | |
constexpr derived_type & | operator= (indirect_component_type const alph) |
Read functions | |
template<typename type > | |
constexpr | operator type () const |
Implicit cast to a single letter. Works only if the type is unique in the type list. | |
template<size_t index> | |
constexpr auto | get (cartesian_composition &l) |
Tuple-like access to the contained components. More... | |
template<typename type > | |
constexpr auto | get (cartesian_composition &l) |
Tuple-like access to the contained components. More... | |
template<size_t index> | |
constexpr auto | get (cartesian_composition const &l) |
Tuple-like access to the contained components. More... | |
template<typename type > | |
constexpr type | get (cartesian_composition const &l) |
Tuple-like access to the contained components. More... | |
The CRTP base for a combined alphabet that contains multiple values of different alphabets at the same time.
first_component_type | Type of the first letter; must model seqan3::semi_alphabet_concept. |
component_types | Types of further letters (up to 4); must model seqan3::semi_alphabet_concept. |
This data structure is CRTP base class for combined alphabets, where the different alphabet letters exist independently as component_list, similar to a tuple.
Short description:
|
inlineexplicit |
Construction via a value of one of the components.
component_type | Must be one uniquely contained in the type list of the composition. |
alph | The value of a component that should be assigned. |
Note: Since the cartesian_composition is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).
|
inlineexplicit |
Construction via a value of a subtype that is assignable to one of the components.
indirect_component_type | Type that models the seqan3::is_assignable_concept for one of the component types. |
alph | The value that should be assigned. |
Note that the value will be assigned to the FIRST type T that fulfils the assignable_concept<T, indirect_component_type>
, regardless if other types are also fit for assignment.
Note: Since the cartesian_composition is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).
|
inlinenoexceptinherited |
Assign from a character.
Satisfies the seqan3::alphabet_concept::assign_char() requirement via the seqan3::assign_char() wrapper.
Constant.
Guaranteed not to throw.
|
inlinenoexceptinherited |
Assign from a numeric value.
Satisfies the seqan3::semi_alphabet_concept::assign_rank() requirement via the seqan3::assign_rank() wrapper.
Constant.
Guaranteed not to throw.
|
inline |
Assignment via a value of one of the components.
component_type | One of the component types. Must be uniquely contained in the type list of the composition. |
alph | The value of a component that should be assigned. |
Note: Since the cartesian_composition is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).
|
inline |
Assignment via a value of a subtype that is assignable to one of the components.
indirect_component_type | Type that models the seqan3::is_assignable_concept for one of the component types. |
alph | The value of a component that should be assigned. |
Note: Since the cartesian_composition is a CRTP base class, we show the working examples with one of its derived classes (seqan3::qualified).
|
inlinenoexceptinherited |
Return the letter as a character of char_type.
Satisfies the seqan3::alphabet_concept::to_char() requirement via the seqan3::to_char() wrapper.
Constant.
Guaranteed not to throw.
|
inlinenoexceptinherited |
Return the letter's numeric value (rank in the alphabet).
Satisfies the seqan3::semi_alphabet_concept::to_rank() requirement via the to_rank() wrapper.
Constant.
Guaranteed not to throw.
|
friend |
Tuple-like access to the contained components.
index | Return the i-th element. |
|
friend |
Tuple-like access to the contained components.
type | Return the element of specified type; only available if the type is unique in the set of components. |
|
friend |
Tuple-like access to the contained components.
index | Return the i-th element. |
|
friend |
Tuple-like access to the contained components.
type | Return the element of specified type; only available if the type is unique in the set of components. |