BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
Custom

Provides customisation tags and alphabet adaptations of standard char and uint types. More...

+ Collaboration diagram for Custom:

Classes

struct  bio::alphabet::custom::assign_char_to
 Customisation tag for bio::alphabet::assign_char_to. More...
 
struct  bio::alphabet::custom::assign_phred_to
 Customisation tag for bio::alphabet::assign_char_to. More...
 
struct  bio::alphabet::custom::assign_rank_to
 Customisation tag for bio::alphabet::assign_rank_to.#. More...
 
struct  bio::alphabet::custom::char_is_valid_for
 Customisation tag for bio::alphabet::assign_char_to. More...
 
struct  bio::alphabet::custom::complement
 Customisation tag for bio::alphabet::complement. More...
 
struct  bio::alphabet::custom::size
 CPO tag definition for bio::alphabet::size. More...
 
struct  bio::alphabet::custom::to_char
 Customisation tag for bio::alphabet::to_char. More...
 
struct  bio::alphabet::custom::to_phred
 Customisation tag for bio::alphabet::assign_char_to. More...
 
struct  bio::alphabet::custom::to_rank
 Customisation tag for bio::alphabet::to_rank. More...
 

Adapt builtin character types as alphabets.

These overloads make char, wchar_t, char16_t and char32_t (but not signed char and unsigned char!) satisfy bio::alphabet::alphabet.

template<bio::meta::nonint_character char_type>
consteval auto bio::alphabet::custom::tag_invoke (size, char_type const) noexcept
 The number of values the char type can take (e.g. 256 for char).
 
template<bio::meta::nonint_character char_type>
constexpr auto bio::alphabet::custom::tag_invoke (to_rank tag, char_type const chr) noexcept
 Convert char to rank by casting to an unsigned integral type of same size.
 
template<bio::meta::nonint_character char_type>
constexpr char_type & bio::alphabet::custom::tag_invoke (assign_rank_to tag, decltype(tag_invoke(to_rank{}, char_type{})) const rank, char_type &chr) noexcept
 Assigning a rank to a char is the same as assigning it a numeric value.
 
template<bio::meta::nonint_character char_type>
constexpr char_type bio::alphabet::custom::tag_invoke (to_char tag, char_type const chr) noexcept
 Converting char to char is no-op (it will just return the value you pass in).
 
template<bio::meta::nonint_character char_type>
constexpr char_type & bio::alphabet::custom::tag_invoke (assign_char_to tag, char_type const chr2, char_type &chr) noexcept
 Assign a char to the char type (same as calling =).
 

Adapt unsigned integral types as semialphabets.

These overloads make uint8_t, uint16_t and uint32_t (but not uint64_t!) satisfy bio::alphabet::semialphabet.

template<alphabet::detail::uint_adaptation uint_type>
consteval auto bio::alphabet::custom::tag_invoke (size tag, uint_type const) noexcept
 The number of values the uint type can take (e.g. 256 for uint8_t).
 
template<alphabet::detail::uint_adaptation uint_type>
constexpr uint_type & bio::alphabet::custom::tag_invoke (assign_rank_to tag, uint_type const intgr2, uint_type &intgr) noexcept
 Assign a rank to to the uint (same as calling =).
 
template<alphabet::detail::uint_adaptation uint_type>
constexpr auto bio::alphabet::custom::tag_invoke (to_rank tag, uint_type const intgr) noexcept
 Converting uint to rank is a no-op (it will just return the value you pass in).
 

Detailed Description

Provides customisation tags and alphabet adaptations of standard char and uint types.

Function Documentation

◆ tag_invoke() [1/6]

template<bio::meta::nonint_character char_type>
constexpr char_type & bio::alphabet::custom::tag_invoke ( assign_char_to  tag,
char_type const  chr2,
char_type &  chr 
)
constexprnoexcept

Assign a char to the char type (same as calling =).

Parameters
[in]tagThe tag for tag_invoke().
[in]chr2The char value you wish to assign.
[in,out]chrThe alphabet letter that you wish to assign to.
Returns
A reference to the alphabet letter you passed in.

◆ tag_invoke() [2/6]

template<bio::meta::nonint_character char_type>
constexpr char_type & bio::alphabet::custom::tag_invoke ( assign_rank_to  tag,
decltype(tag_invoke(to_rank{}, char_type{})) const  rank,
char_type &  chr 
)
constexprnoexcept

Assigning a rank to a char is the same as assigning it a numeric value.

Parameters
[in]tagThe tag for tag_invoke().
[in]rankThe rank value you wish to assign.
[in,out]chrThe alphabet letter that you wish to assign to.
Returns
A reference to the alphabet letter you passed in.

◆ tag_invoke() [3/6]

template<alphabet::detail::uint_adaptation uint_type>
constexpr uint_type & bio::alphabet::custom::tag_invoke ( assign_rank_to  tag,
uint_type const  intgr2,
uint_type &  intgr 
)
constexprnoexcept

Assign a rank to to the uint (same as calling =).

Parameters
[in]tagThe tag for tag_invoke().
[in]intgr2The rank value you wish to assign.
[in,out]intgrThe alphabet letter that you wish to assign to.
Returns
A reference to the modified alphabet letter you passed in.

◆ tag_invoke() [4/6]

template<bio::meta::nonint_character char_type>
constexpr char_type bio::alphabet::custom::tag_invoke ( to_char  tag,
char_type const  chr 
)
constexprnoexcept

Converting char to char is no-op (it will just return the value you pass in).

Parameters
[in]tagThe tag for tag_invoke().
[in]chrThe alphabet letter that you wish to convert to char (no-op).
Returns
chr.

◆ tag_invoke() [5/6]

template<bio::meta::nonint_character char_type>
constexpr auto bio::alphabet::custom::tag_invoke ( to_rank  tag,
char_type const  chr 
)
constexprnoexcept

Convert char to rank by casting to an unsigned integral type of same size.

Parameters
[in]tagThe tag for tag_invoke().
[in]chrThe alphabet letter that you wish to convert to rank.
Returns
The letter's value in the alphabet's rank type (usually a uint*_t).

◆ tag_invoke() [6/6]

template<alphabet::detail::uint_adaptation uint_type>
constexpr auto bio::alphabet::custom::tag_invoke ( to_rank  tag,
uint_type const  intgr 
)
constexprnoexcept

Converting uint to rank is a no-op (it will just return the value you pass in).

Parameters
[in]tagThe tag for tag_invoke().
[in]intgrThe alphabet letter that you wish to convert to rank.
Returns
intgr.