SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
seqan3::mask Class Reference

Implementation of a masked alphabet to be used for tuple composites. More...

#include <seqan3/alphabet/mask/mask.hpp>

+ Inheritance diagram for seqan3::mask:

Public Member Functions

Constructors, destructor and assignment
constexpr mask ()=default
 Defaulted.
 
constexpr mask (mask const &)=default
 Defaulted.
 
constexpr mask (mask &&)=default
 Defaulted.
 
constexpr maskoperator= (mask const &)=default
 Defaulted.
 
constexpr maskoperator= (mask &&)=default
 Defaulted.
 
 ~mask ()=default
 
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 maskassign_char (char_type const c) noexcept
 Assign from a character, implicitly converts invalid characters. More...
 
constexpr maskassign_rank (rank_type const c) noexcept
 Assign from a numeric value. More...
 

Static Public Attributes

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. More...
 
Boolean values

Static member "booleans" that can be assigned to the alphabet or used in aggregate initialization.

Similar to an Enum interface.

static const mask UNMASKED {mask{}.assign_rank(0)}
 Member for UNMASKED.
 
static const mask MASKED {mask{}.assign_rank(1)}
 

Protected Types

Member types
using char_type = std::conditional_t< std::same_as< void, void >, char, void >
 The char representation; conditional needed to make semi alphabet definitions legal. More...
 
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()). More...
 

Detailed Description

Implementation of a masked alphabet to be used for tuple composites.

This alphabet is not usually used directly, but instead via seqan3::masked. For more information see the Mask submodule .

int main()
{
seqan3::mask another_mask{};
my_mask.assign_rank(false); // will assign my_mask the value mask::UNMASKED
another_mask.assign_rank(0); // will also assign another_mask the value mask::UNMASKED
if (my_mask.to_rank() == another_mask.to_rank())
seqan3::debug_stream << "Both are UNMASKED!\n";
}
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:132
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:185
Implementation of a masked alphabet to be used for tuple composites.
Definition: mask.hpp:35
static const mask MASKED
Definition: mask.hpp:61
Provides seqan3::debug_stream and related types.
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:42
Create a mask composite which can be applied with another alphabet.

Member Typedef Documentation

◆ char_type

using seqan3::alphabet_base< mask , size, void >::char_type = std::conditional_t<std::same_as<void , void>, char, void >
protectedinherited

The char representation; conditional needed to make semi alphabet definitions legal.

We need a return type for seqan3::alphabet_base::to_char and seqan3::alphabet_base::assign_char other than void to make these in-class definitions valid when char_t is void.

This entity is stable. Since version 3.1.

◆ rank_type

using seqan3::alphabet_base< mask , size, void >::rank_type = detail::min_viable_uint_t<size - 1>
protectedinherited

The type of the alphabet when represented as a number (e.g. via to_rank()).

This entity is stable. Since version 3.1.

Constructor & Destructor Documentation

◆ ~mask()

seqan3::mask::~mask ( )
default

Defaulted.

Member Function Documentation

◆ assign_char()

constexpr mask & seqan3::alphabet_base< mask , size, void >::assign_char ( char_type const  c)
inlineconstexprnoexceptinherited

Assign from a character, implicitly converts invalid characters.

Parameters
cThe character to be assigned.

Provides an implementation for seqan3::assign_char_to, required to model seqan3::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

◆ assign_rank()

constexpr mask & seqan3::alphabet_base< mask , size, void >::assign_rank ( rank_type const  c)
inlineconstexprnoexceptinherited

Assign from a numeric value.

Parameters
cThe rank to be assigned.

Provides an implementation for seqan3::assign_rank_to, required to model seqan3::semialphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

◆ to_char()

constexpr char_type seqan3::alphabet_base< mask , size, void >::to_char ( ) const
inlineconstexprnoexceptinherited

Return the letter as a character of char_type.

Provides an implementation for seqan3::to_char, required to model seqan3::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

◆ to_rank()

constexpr rank_type seqan3::alphabet_base< mask , size, void >::to_rank ( ) const
inlineconstexprnoexceptinherited

Return the letter's numeric value (rank in the alphabet).

Provides an implementation for seqan3::to_rank, required to model seqan3::semialphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

Member Data Documentation

◆ alphabet_size

constexpr detail::min_viable_uint_t<size> seqan3::alphabet_base< mask , size, void >::alphabet_size
staticconstexprinherited

The size of the alphabet, i.e. the number of different values it can take.

This entity is stable. Since version 3.1.

◆ MASKED

constexpr mask seqan3::mask::MASKED {mask{}.assign_rank(1)}
staticconstexpr

Member for MASKED.


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