SeqAn3
Core

Contains core functionality used by multiple modules. More...

Collaboration diagram for Core:

Modules

 Concept
 Additional concepts that are not specific to a SeqAn3 module.
 
 Metafunction
 Provide various metafunctions.
 
 Simd
 The simd module contains a unified interface to provide simd types and functions used in seqan3.
 

Classes

interface  seqan3::cereal_archive_concept
 All archives of the Cereal library satisfy this. More...
 
interface  seqan3::cereal_input_archive_concept
 All input archives of the Cereal library satisfy this. More...
 
interface  seqan3::cereal_output_archive_concept
 All output archives of the Cereal library satisfy this. More...
 
interface  seqan3::cereal_text_archive_concept
 All text archives of the Cereal library satisfy this. More...
 
interface  seqan3::cerealisable_concept
 Specifies the requirements for types that are serialisable via Cereal. More...
 
struct  seqan3::pod_tuple< type0 >
 Recursion anchor for pod_tuple. More...
 
struct  seqan3::pod_tuple< type0, types... >
 endcond More...
 
interface  seqan3::tuple_like_concept
 Whether a type behaves like a tuple. More...
 

Macros

#define SEQAN3_WITH_CEREAL   0
 Whether CEREAL support is available or not.
 
#define SEQAN3_WITH_LEMON   0
 Whether Lemon support is available or not.
 

Typedefs

template<typename ... types>
using seqan3::type_list = meta::list< types... >
 Type that contains multiple types, an alias for meta::list.
 

Variables

template<typename t >
constexpr bool seqan3::add_enum_bitwise_operators = false
 Set to true for a scoped enum to have binary operators overloaded. More...
 

Tuple utility functions

Helper functions for tuple like objects.

template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split (tuple_t< ts... > const &t)
 Splits a tuple like data structure at the given position. More...
 
template<typename pivot_t , tuple_like_concept tuple_t>
constexpr auto seqan3::tuple_split (tuple_t &&t)
 Splits a tuple like data structure at the first position of the given type. More...
 
template<tuple_like_concept tuple_t>
constexpr auto seqan3::tuple_pop_front (tuple_t &&t)
 Removes the first element of a tuple. More...
 
template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split (tuple_t< ts... > &&t)
 Splits a tuple like data structure at the given position. More...
 

Detailed Description

Contains core functionality used by multiple modules.

The core module contains concepts, functions and some classes that are used by multiple other modules, but that usually are not relevant to most users of the library.

Function Documentation

◆ tuple_pop_front()

template<tuple_like_concept tuple_t>
constexpr auto seqan3::tuple_pop_front ( tuple_t &&  t)

Removes the first element of a tuple.

Parameters
[in]tThe original tuple.
Returns
A new tuple without the first element of t.

Note, that the tuple must contain at least one element and must support empty tuple types, i.e. std::pair cannot be used.

Complexity

Linear in the number of elements.

Thread safety

Concurrent invocations of this functions are thread safe.

◆ tuple_split() [1/3]

template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split ( tuple_t< ts... > const &  t)

Splits a tuple like data structure at the given position.

Template Parameters
pivot_cA template value specifying the split position.
tuple_tA template alias for a tuple like object.
...tsTypes tuple_t is specified with.
Parameters
[in]tThe original tuple to split.
Returns
A new tuple of tuples with the left side of the split and the right side of the split.

Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.

example

// Split at position 2.
std::tuple<int, char, float, std::string> t{1, 'c', 0.3, "hello"};
auto [left, right] = tuple_split<2>(t); // decltype(left) -> std::tuple<int, char>; decltype(right) -> std::tuple<float, std::string>;
// Split at position 0.
auto [left1, right1] = tuple_split<0>(t); // decltype(left1) -> std::tuple<>; decltype(right1) -> std::tuple<int, char, float, std::string>;
// Split at position 4.
auto [left2, right2] = tuple_split<4>(t); // decltype(left1) -> std::tuple<int, char, float, std::string>; decltype(right1) -> std::tuple<>;

Complexity

Linear in the number of elements.

Thread safety

Concurrent invocations of this functions are thread safe.

◆ tuple_split() [2/3]

template<size_t pivot_c, template< typename ... > typename tuple_t, typename ... ts>
constexpr auto seqan3::tuple_split ( tuple_t< ts... > &&  t)

Splits a tuple like data structure at the given position.

Template Parameters
pivot_cA template value specifying the split position.
tuple_tA template alias for a tuple like object.
...tsTypes tuple_t is specified with.
Parameters
[in]tThe original tuple to split.
Returns
A new tuple of tuples with the left side of the split and the right side of the split.

Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.

example

// Split at position 2.
std::tuple<int, char, float, std::string> t{1, 'c', 0.3, "hello"};
auto [left, right] = tuple_split<2>(t); // decltype(left) -> std::tuple<int, char>; decltype(right) -> std::tuple<float, std::string>;
// Split at position 0.
auto [left1, right1] = tuple_split<0>(t); // decltype(left1) -> std::tuple<>; decltype(right1) -> std::tuple<int, char, float, std::string>;
// Split at position 4.
auto [left2, right2] = tuple_split<4>(t); // decltype(left1) -> std::tuple<int, char, float, std::string>; decltype(right1) -> std::tuple<>;

Complexity

Linear in the number of elements.

Thread safety

Concurrent invocations of this functions are thread safe.

◆ tuple_split() [3/3]

template<typename pivot_t , tuple_like_concept tuple_t>
constexpr auto seqan3::tuple_split ( tuple_t &&  t)

Splits a tuple like data structure at the first position of the given type.

Template Parameters
pivot_tA template type specifying the split position.
Parameters
[in]tThe original tuple to split.
Returns
A new tuple of tuples with the left side of the split and the right side of the split.
Template Parameters
pivot_cA template value specifying the split position.
tuple_tA template alias for a tuple like object.
...tsTypes tuple_t is specified with.
Parameters
[in]tThe original tuple to split.
Returns
A new tuple of tuples with the left side of the split and the right side of the split.

Splits a tuple into two tuples, while the element at the split position will be contained in the second tuple. Note, that the returned tuples can be empty. For this reason it is not possible to use tuple like objects, that cannot be empty, i.e. std::pair. Using such an object will emit an compiler error.

example

// Split at position 2.
std::tuple<int, char, float, std::string> t{1, 'c', 0.3, "hello"};
auto [left, right] = tuple_split<2>(t); // decltype(left) -> std::tuple<int, char>; decltype(right) -> std::tuple<float, std::string>;
// Split at position 0.
auto [left1, right1] = tuple_split<0>(t); // decltype(left1) -> std::tuple<>; decltype(right1) -> std::tuple<int, char, float, std::string>;
// Split at position 4.
auto [left2, right2] = tuple_split<4>(t); // decltype(left1) -> std::tuple<int, char, float, std::string>; decltype(right1) -> std::tuple<>;

Complexity

Linear in the number of elements.

Thread safety

Concurrent invocations of this functions are thread safe.

Variable Documentation

◆ add_enum_bitwise_operators

template<typename t >
constexpr bool seqan3::add_enum_bitwise_operators = false

Set to true for a scoped enum to have binary operators overloaded.

If this metafunction is specialised for an enum, the binary operators &, |, ^, ~, &=, |=, ^= will be added and behave just like for ints or unscoped enums.

Example

enum class my_enum
{
VAL1 = 1,
VAL2 = 2,
COMB = 3
};
template <>
constexpr bool seqan3::add_enum_bitwise_operators<my_enum> = true;
my_enum e = my_enum::VAL1;
my_enum e2 = e | my_enum::VAL2;
// e2 == my_enum::COMB;