SeqAn3
Adaptation

Contains alphabet adaptions of some standard char and uint types. More...

Collaboration diagram for Adaptation:

Classes

struct  seqan3::alphabet_size< char_type >
 Specialisation of seqan3::alphabet_size that delegates for char types. More...
 
struct  seqan3::alphabet_size< uint_type >
 Specialisation of seqan3::alphabet_size that delegates for uint types. More...
 
interface  seqan3::char_adaptation_concept
 A concept that covers char type adaptations for seqan3::alphabet_concept. More...
 
interface  seqan3::uint_adaptation_concept
 A concept that covers uint type adaptations for seqan3::alphabet_concept. More...
 
struct  seqan3::underlying_char< char_type >
 Specialisation of seqan3::underlying_char for char types. More...
 
struct  seqan3::underlying_char< uint_type >
 Specialisation of seqan3::underlying_char for uint types. More...
 
struct  seqan3::underlying_rank< char_type >
 Specialisation of seqan3::underlying_rank for char types. More...
 
struct  seqan3::underlying_rank< uint_type >
 Specialisation of seqan3::underlying_rank for uint types. More...
 

Free function wrappers for the char alphabet adaptation

For char, char16_t and char32_t do conversion to/from uint types.

template<typename char_type >
constexpr underlying_char_t< char_type > to_char (char_type const chr) requires detail
 Converting char to char is no-op (it will just return the value you pass in). More...
 
template<typename char_type >
constexpr underlying_rank_t< char_type > to_rank (char_type const chr) requires detail
 Convert char to rank by casting to an unsigned integral type of same size. More...
 
template<typename char_type >
constexpr char_type & assign_char (char_type &chr, underlying_char_t< char_type > const chr2) requires detail
 Assign a char to the char type (same as calling =). More...
 
template<typename char_type >
constexpr char_type && assign_char (char_type &&chr, underlying_char_t< char_type > const chr2) requires detail
 Assign a char to the char type (same as calling =). More...
 
template<typename char_type >
constexpr char_type & assign_rank (char_type &chr, underlying_rank_t< char_type > const rank) requires detail
 Assigning a rank to a char is the same as assigning it a numeric value. More...
 
template<typename char_type >
constexpr char_type && assign_rank (char_type &&chr, underlying_rank_t< char_type > const rank) requires detail
 Assigning a rank to a char is the same as assigning it a numeric value. More...
 

Free function wrappers for the uint alphabet adaptation

For uint8_t, uint16_t and uint32_t do conversion to/from char types.

template<typename uint_type >
constexpr underlying_char_t< uint_type > to_char (uint_type const intgr) requires detail
 Converting uint to char casts to a character type of same size. More...
 
template<typename uint_type >
constexpr underlying_rank_t< uint_type > to_rank (uint_type const intgr) requires detail
 Converting uint to rank is a no-op (it will just return the value you pass in). More...
 
template<typename uint_type >
constexpr uint_type & assign_char (uint_type &intgr, underlying_char_t< uint_type > const chr) requires detail
 Assign from a character type via implicit or explicit cast. More...
 
template<typename uint_type >
constexpr uint_type && assign_char (uint_type &&intgr, underlying_char_t< uint_type > const chr) requires detail
 Assign from a character type via implicit or explicit cast. More...
 
template<typename uint_type >
constexpr uint_type & assign_rank (uint_type &intgr, underlying_rank_t< uint_type > const intgr2) requires detail
 Assign a rank to to the uint (same as calling =). More...
 
template<typename uint_type >
constexpr uint_type && assign_rank (uint_type &&intgr, underlying_rank_t< uint_type > const intgr2) requires detail
 Assign a rank to to the uint (same as calling =). More...
 

Detailed Description

Contains alphabet adaptions of some standard char and uint types.

Function Documentation

◆ assign_char() [1/4]

template<typename uint_type >
constexpr uint_type & assign_char ( uint_type &  intgr,
underlying_char_t< uint_type > const  chr 
)
related

Assign from a character type via implicit or explicit cast.

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrThe alphabet letter that you wish to assign to.
chrThe char value you wish to assign.
Returns
A reference to the alphabet letter you passed in.

◆ assign_char() [2/4]

template<typename char_type >
constexpr char_type & assign_char ( char_type &  chr,
underlying_char_t< char_type > const  chr2 
)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
chrThe alphabet letter that you wish to assign to.
chr2The char value you wish to assign.
Returns
A reference to the alphabet letter you passed in.

◆ assign_char() [3/4]

template<typename uint_type >
constexpr uint_type && assign_char ( uint_type &&  intgr,
underlying_char_t< uint_type > const  chr 
)
related

Assign from a character type via implicit or explicit cast.

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrAn alphabet letter temporary.
chrThe char value you wish to assign.
Returns
The assignment result as a temporary.

Use this e.g. to newly create alphabet letters from uint:

auto my_letter = assign_char(dna5{}, 'G'); // my_letter is of type dna5 and == 'G'_dna5

◆ assign_char() [4/4]

template<typename char_type >
constexpr char_type && assign_char ( char_type &&  chr,
underlying_char_t< char_type > const  chr2 
)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
chrAn alphabet letter temporary.
chr2The char value you wish to assign.
Returns
The assignment result as a temporary.

◆ assign_rank() [1/4]

template<typename uint_type >
constexpr uint_type & assign_rank ( uint_type &  intgr,
underlying_rank_t< uint_type > const  intgr2 
)
related

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

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrThe alphabet letter that you wish to assign to.
intgr2The rank value you wish to assign.
Returns
A reference to the alphabet letter you passed in.

◆ assign_rank() [2/4]

template<typename char_type >
constexpr char_type & assign_rank ( char_type &  chr,
underlying_rank_t< char_type > const  rank 
)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
chrThe alphabet letter that you wish to assign to.
rankThe rank value you wish to assign.
Returns
A reference to the alphabet letter you passed in.

◆ assign_rank() [3/4]

template<typename char_type >
constexpr char_type && assign_rank ( char_type &&  chr,
underlying_rank_t< char_type > const  rank 
)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
chrAn alphabet letter temporary.
rankThe rank value you wish to assign.
Returns
The assignment result as a temporary.

◆ assign_rank() [4/4]

template<typename uint_type >
constexpr uint_type && assign_rank ( uint_type &&  intgr,
underlying_rank_t< uint_type > const  intgr2 
)
related

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

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrAn alphabet letter temporary.
intgr2The rank value you wish to assign.
Returns
The assignment result as a temporary.

Use this e.g. to newly create alphabet letters from rank:

auto my_letter = assign_rank(dna5{}, 1); // my_letter is of type dna5 and == 'C'_dna5

◆ to_char() [1/2]

template<typename uint_type >
constexpr underlying_char_t< uint_type > to_char ( uint_type const  intgr)
related

Converting uint to char casts to a character type of same size.

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrThe alphabet letter that you wish to convert to char.
Returns
The letter's value in the alphabet's rank type (usually uint).

◆ to_char() [2/2]

template<typename char_type >
constexpr underlying_char_t< char_type > to_char ( char_type const  chr)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
chrThe alphabet letter that you wish to convert to char.
Returns
The letter's value in the alphabet's rank type (usually char).

◆ to_rank() [1/2]

template<typename uint_type >
constexpr underlying_rank_t< uint_type > to_rank ( uint_type const  intgr)
related

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

Template Parameters
uint_typeOne of uint8_t, uint16_t or uint32_t.
Parameters
intgrThe alphabet letter that you wish to convert to rank.
Returns
The letter's value in the alphabet's rank type (usually a uint*_t).

◆ to_rank() [2/2]

template<typename char_type >
constexpr underlying_rank_t< char_type > to_rank ( char_type const  chr)
related

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

Template Parameters
char_typeOne of char, char16_t, char32_t or wchar_t.
Parameters
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).