SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::exposition_only::cigar_operation Class Reference

The actual implementation of seqan3::cigar::operation for documentation purposes only. More...

#include <seqan3/alphabet/cigar/exposition_only/cigar_operation.hpp>

+ Inheritance diagram for seqan3::exposition_only::cigar_operation:

Public Member Functions

Constructors, destructor and assignment
constexpr cigar_operation () noexcept=default
 Defaulted.
 
constexpr cigar_operation (cigar_operation const &) noexcept=default
 Defaulted.
 
constexpr cigar_operation (cigar_operation &&) noexcept=default
 Defaulted.
 
constexpr cigar_operationoperator= (cigar_operation const &) noexcept=default
 Defaulted.
 
constexpr cigar_operationoperator= (cigar_operation &&) noexcept=default
 Defaulted.
 
 ~cigar_operation () noexcept=default
 Defaulted.
 
- Public Member Functions inherited from seqan3::alphabet_base< cigar_operation, 9, char >
constexpr alphabet_base () noexcept=default
 Defaulted.
 
constexpr alphabet_base (alphabet_base const &) noexcept=default
 Defaulted.
 
constexpr alphabet_base (alphabet_base &&) noexcept=default
 Defaulted.
 
constexpr alphabet_baseoperator= (alphabet_base const &) noexcept=default
 Defaulted.
 
constexpr alphabet_baseoperator= (alphabet_base &&) noexcept=default
 Defaulted.
 
 ~alphabet_base () noexcept=default
 Defaulted.
 
constexpr char_type to_char () const noexcept
 Return the letter as a character of char_type.
 
constexpr rank_type to_rank () const noexcept
 Return the letter's numeric value (rank in the alphabet).
 
constexpr cigar_operation & assign_char (char_type const chr) noexcept
 Assign from a character, implicitly converts invalid characters.
 
constexpr cigar_operation & assign_rank (rank_type const c) noexcept
 Assign from a numeric value.
 

Private Types

using base_t = alphabet_base< cigar_operation, 9, char >
 The base class.
 

Static Private Member Functions

static constexpr rank_type char_to_rank (char_type const chr)
 Returns the rank representation of character.
 
static constexpr char_type rank_to_char (rank_type const rank)
 Returns the character representation of rank.
 

Private Attributes

friend base_t
 Befriend seqan3::alphabet_base.
 

Static Private Attributes

static constexpr std::array< rank_type, 256 > char_to_rank_table
 The lookup table used in char_to_rank.
 
static constexpr char_type rank_to_char_table [alphabet_size] {'M', 'D', 'I', 'S', 'H', 'N', 'P', 'X', '='}
 The lookup table used in rank_to_char.
 

Additional Inherited Members

- Static Public Attributes inherited from seqan3::alphabet_base< cigar_operation, 9, char >
static constexpr detail::min_viable_uint_t< size > alphabet_size
 The size of the alphabet, i.e. the number of different values it can take.
 
- Protected Types inherited from seqan3::alphabet_base< cigar_operation, 9, char >
using char_type = std::conditional_t< std::same_as< char, void >, char, char >
 The char representation; conditional needed to make semi alphabet definitions legal.
 
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()).
 

Detailed Description

The actual implementation of seqan3::cigar::operation for documentation purposes only.

Note
This class only exists because of technical reasons, please always use seqan3::cigar::operation instead of seqan3::exposition_only::cigar_operation.
We cannot declare seqan3::cigar::operation in-class, because we need to specify the second tuple element of seqan3::alphabet_tuple_base before we actually can declare it in-class. This is a trade-off to make seqan3::cigar a non-template class.
See also
seqan3::exposition_only for an explanation on exposition-only.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Please always use seqan3::cigar::operation. The API-Stability of all members documented in this class applies directly to seqan3::cigar::operation.

Member Function Documentation

◆ char_to_rank()

static constexpr rank_type seqan3::exposition_only::cigar_operation::char_to_rank ( char_type const  chr)
inlinestaticconstexprprivate

Returns the rank representation of character.

This function is required by seqan3::alphabet_base.

◆ rank_to_char()

static constexpr char_type seqan3::exposition_only::cigar_operation::rank_to_char ( rank_type const  rank)
inlinestaticconstexprprivate

Returns the character representation of rank.

This function is required by seqan3::alphabet_base.

Member Data Documentation

◆ char_to_rank_table

constexpr std::array<rank_type, 256> seqan3::exposition_only::cigar_operation::char_to_rank_table
staticconstexprprivate
Initial value:
{[]() constexpr
{
for (size_t rnk = 0u; rnk < alphabet_size; ++rnk)
{
ret[rank_to_char_table[rnk]] = rnk;
}
return ret;
}()}
static constexpr detail::min_viable_uint_t< size > alphabet_size
The size of the alphabet, i.e. the number of different values it can take.
Definition alphabet_base.hpp:196
static constexpr char_type rank_to_char_table[alphabet_size]
The lookup table used in rank_to_char.
Definition cigar_operation.hpp:68

The lookup table used in char_to_rank.

We would have defined these lookup tables directly within their respective constexpr functions, but at the time of writing this, gcc did not (clang >= 4 did!) auto-generate lookup tables.

static constexpr char_type rank_to_char(rank_type const rank)
{
// not possible because of static not being allowed within a constexpr function
static constexpr lookup_table = ...;
return lookup_table[rank];
}
static constexpr char_type rank_to_char(rank_type const rank)
{
// up-to the compiler to optimise, no guarantee that a lookup table is used.
constexpr lookup_table = ...;
return lookup_table[rank];
}
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition alphabet_base.hpp:77
std::conditional_t< std::same_as< char, void >, char, char > char_type
The char representation; conditional needed to make semi alphabet definitions legal.
Definition alphabet_base.hpp:69
rank_type rank
The value of the alphabet letter is stored as the rank.
Definition alphabet_base.hpp:258
static constexpr char_type rank_to_char(rank_type const rank)
Returns the character representation of rank.
Definition cigar_operation.hpp:85
See also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99320 for the progress on gcc

◆ rank_to_char_table

constexpr char_type seqan3::exposition_only::cigar_operation::rank_to_char_table[alphabet_size] {'M', 'D', 'I', 'S', 'H', 'N', 'P', 'X', '='}
staticconstexprprivate

The lookup table used in rank_to_char.

We would have defined these lookup tables directly within their respective constexpr functions, but at the time of writing this, gcc did not (clang >= 4 did!) auto-generate lookup tables.

static constexpr char_type rank_to_char(rank_type const rank)
{
// not possible because of static not being allowed within a constexpr function
static constexpr lookup_table = ...;
return lookup_table[rank];
}
static constexpr char_type rank_to_char(rank_type const rank)
{
// up-to the compiler to optimise, no guarantee that a lookup table is used.
constexpr lookup_table = ...;
return lookup_table[rank];
}
See also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99320 for the progress on gcc

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