BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
bio::alphabet::gap Class Reference

The alphabet of a gap character '-'. More...

#include <bio/alphabet/gap/gap.hpp>

+ Inheritance diagram for bio::alphabet::gap:

Public Member Functions

Constructors, destructor and assignment
constexpr gap () noexcept=default
 Defaulted.
 
constexpr gap (gap const &)=default
 Defaulted.
 
constexpr gap (gap &&) noexcept=default
 Defaulted.
 
constexpr gapoperator= (gap const &)=default
 Defaulted.
 
constexpr gapoperator= (gap &&) noexcept=default
 Defaulted.
 
 ~gap ()=default
 Defaulted.
 
Read functions
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).
 
Write functions
constexpr gapassign_char (char_type const c) noexcept
 Assign from a character, implicitly converts invalid characters.
 
constexpr gapassign_rank (rank_type const c) noexcept
 Assign from a numeric value.
 

Static Public Attributes

static constexpr size_t alphabet_size
 The size of the alphabet, i.e. the number of different values it can take.
 

Protected Types

Member types
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 = meta::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 alphabet of a gap character '-'

.

The alphabet always has the same value ('-').

#include <iostream>
int main()
{
bio::alphabet::gap another_gap{};
another_gap.assign_char('A'); // this does not change anything
fmt::print("{}", my_gap.to_char()); // outputs '-'
if (my_gap.to_char() == another_gap.to_char())
fmt::print("Both gaps are the same!");
}
constexpr char_type to_char() const noexcept
Return the letter as a character of char_type.
Definition: base.hpp:104
constexpr derived_type & assign_char(char_type const c) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: base.hpp:145
The alphabet of a gap character '-'.
Definition: gap.hpp:38
Core alphabet concept and free function/type trait wrappers.
Provides bio::alphabet::gap.

Member Function Documentation

◆ assign_char()

constexpr gap & bio::alphabet::base< gap , size, char >::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 bio::alphabet::assign_char_to, required to model bio::alphabet::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ assign_rank()

constexpr gap & bio::alphabet::base< gap , size, char >::assign_rank ( rank_type const  c)
inlineconstexprnoexceptinherited

Assign from a numeric value.

Parameters
cThe rank to be assigned.

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

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_char()

constexpr char_type bio::alphabet::base< gap , size, char >::to_char ( ) const
inlineconstexprnoexceptinherited

Return the letter as a character of char_type.

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

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_rank()

constexpr rank_type bio::alphabet::base< gap , size, char >::to_rank ( ) const
inlineconstexprnoexceptinherited

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

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

Complexity

Constant.

Exceptions

Guaranteed not to throw.


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