SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
Core

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

+ Collaboration diagram for Core:

Modules

 Algorithm
 Provides core functionality used for algorithms.
 
 Concept
 Provides core concepts.
 
 Configuration
 Provides core functionality used to configure configurations.
 
 Debug Stream
 Provides core functionality used to print seqan3 and std types.
 
 Range
 Provides seqan3 general purpose range functionality.
 

Concepts

concept  seqan3::detail::boxable
 Helper concept for seqan3::detail::copyable_wrapper.
 
concept  seqan3::detail::type_list_of_sequence_file_input_formats
 Auxiliary concept that checks whether a type is a seqan3::type_list and all types meet seqan3::sequence_file_input_format.
 
concept  seqan3::detail::type_list_of_structure_file_input_formats
 Auxiliary concept that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_input_format.
 
concept  seqan3::detail::type_list_of_structure_file_output_formats
 Auxiliary concept that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_output_format.
 

Classes

class  seqan3::detail::copyable_wrapper< t >
 Utility wrapper that behaves like std::optional but makes the type conform with the std::copyable concept. More...
 
class  seqan3::detail::copyable_wrapper< t >
 Utility wrapper that behaves like std::optional but makes the type conform with the std::copyable concept. More...
 
struct  seqan3::detail::customisation_point_object< derived_t, max_priority >
 A CRTP base-class that defines a customisation_point_object (CPO). More...
 
struct  seqan3::detail::deferred_crtp_base< crtp_base, args_t >
 An invocable wrapper that defers the instantiation of a crtp_base class. More...
 
struct  seqan3::detail::deferred_crtp_base_vargs< crtp_base, args >
 An invocable wrapper that defers the instantiation of a crtp_base class. More...
 
interface  derived_from_strong_type
 Defines the requirements of a seqan3::detail::strong_type specialisation. More...
 
struct  seqan3::detail::empty_type
 An empty class type used in meta programming. More...
 
struct  seqan3::detail::is_class_template_declarable_with< query_t, args_t >
 An unary type trait that tests whether a template class can be declared with the given template type parameters. More...
 
struct  seqan3::detail::is_type_specialisation_of< source_t, target_template >
 Determines whether a source_type is a specialisation of another template. More...
 
struct  seqan3::detail::is_value_specialisation_of< source_t, target_template >
 Determines whether a source_type is a specialisation of another template. More...
 
struct  seqan3::detail::iter_pointer< it_t >
 This is like std::iter_value_t, but for the pointer type. More...
 
struct  seqan3::detail::maybe_inherited_iterator_category< underling_iterator_t >
 This handles more cases than maybe_iterator_category if you inherit the underling_iterator_t. More...
 
struct  seqan3::detail::maybe_iterator_category< underlying_iterator_t >
 Defines iterator_category member if underlying_iterator_t has a valid std::iterator_traits::iterator_category overload. More...
 
struct  seqan3::detail::priority_tag< I >
 A tag that allows controlled overload resolution via implicit base conversion rules. More...
 
class  seqan3::detail::strong_type< value_t, derived_t, skills_ >
 CRTP base class to declare a strong typedef for a regular type to avoid ambiguous parameter settings in function calls. More...
 
interface  template_specialisation_of
 Provides concept seqan3::template_specialisation_of<mytype, [...]> for checking the type specialisation of some type with a given template, for example a specialized type_list<float> with the type_list template. More...
 
struct  seqan3::detail::transfer_template_args_onto< source_template< source_arg_types... >, target_template >
 Extracts a type template's type arguments and specialises another template with them. More...
 
struct  seqan3::detail::transfer_template_vargs_onto< source_template< source_varg_types... >, target_template >
 Extracts a type template's non-type arguments and specialises another template with them. More...
 
struct  seqan3::detail::transfer_type_modifier_onto< source_t, target_t >
 Transfers the type modifier &, && and const (and any combination) to the target type. More...
 
struct  seqan3::detail::valid_template_spec_or< fallback_t, templ_t, spec_t >
 Exposes templ_t<spec_t...> if that is valid, otherwise fallback_t. More...
 

Macros

#define SEQAN3_COMPILER_IS_GCC   0
 Whether the current compiler is GCC.
 
#define SEQAN3_CPO_OVERLOAD(...)   cpo_overload(__VA_ARGS__) SEQAN3_CPO_OVERLOAD_BODY
 A macro that helps to define a seqan3::detail::customisation_point_object.
 
#define SEQAN3_CPO_OVERLOAD_BODY(...)
 A macro helper for SEQAN3_CPO_OVERLOAD.
 
#define SEQAN3_WITH_CEREAL   0
 Whether CEREAL support is available or not.
 

Typedefs

using seqan3::detail::all = seqan::stl::views::all
 Returns a view that includes all elements of the range argument.
 
using seqan3::detail::all_t = seqan::stl::views::all_t
 Returns the type that results from appying seqan3::detail::all to a range.
 
template<typename t >
using seqan3::detail::copyable_wrapper_t = copyable_wrapper< std::remove_reference_t< t > >
 Utility transformation trait to get a wrapper type that models std::copyable.
 
template<typename deferred_crtp_base_t , typename derived_t >
using seqan3::detail::invoke_deferred_crtp_base = typename deferred_crtp_base_t::template invoke< derived_t >
 Template alias to instantiate the deferred crtp base with the derived class.
 
template<typename it_t >
using seqan3::detail::iter_pointer_t = typename iter_pointer< it_t >::type
 Return the pointer type of the input type (transformation_trait shortcut).
 
template<typename it_t >
using seqan3::detail::iterator_concept_tag_t = std::conditional_t< std::contiguous_iterator< it_t >, std::contiguous_iterator_tag, std::conditional_t< std::random_access_iterator< it_t >, std::random_access_iterator_tag, std::conditional_t< std::bidirectional_iterator< it_t >, std::bidirectional_iterator_tag, std::conditional_t< std::forward_iterator< it_t >, std::forward_iterator_tag, std::conditional_t< std::input_iterator< it_t >, std::input_iterator_tag, std::output_iterator_tag > > > > >
 Exposes the iterator_concept from the modelled concept.
 
using seqan3::detail::owning_view = seqan::stl::ranges::owning_view
 A move-only view that takes unique ownership of a range.
 
template<typename t >
using seqan3::detail::strip_type_identity_t = std::conditional_t< is_type_specialisation_of_v< t, std::type_identity >, transformation_trait_or_t< t, void >, t >
 A transformation trait shortcut that returns the type inside a std::type_identity or the type itself.
 
template<typename source_type , template< typename... > typename target_template>
using seqan3::detail::transfer_template_args_onto_t = typename transfer_template_args_onto< source_type, target_template >::type
 Shortcut for seqan3::detail::transfer_template_args_onto (transformation_trait shortcut).
 
template<typename source_type , template< auto... > typename target_template>
using seqan3::detail::transfer_template_vargs_onto_t = typename transfer_template_vargs_onto< source_type, target_template >::type
 Shortcut for seqan3::detail::transfer_template_vargs_onto (transformation_trait shortcut).
 
template<typename fallback_t , template< typename... > typename templ_t, typename... spec_t>
using seqan3::detail::valid_template_spec_or_t = typename valid_template_spec_or< fallback_t, templ_t, spec_t... >::type
 Helper for seqan3::detail::valid_template_spec_or (transformation_trait shortcut).
 

Enumerations

enum struct  seqan3::detail::strong_type_skill {
  none = 0 , add = 1 << 0 , subtract = 1 << 1 , multiply = 1 << 2 ,
  divide = 1 << 3 , modulo = 1 << 4 , bitwise_and = 1 << 5 , bitwise_or = 1 << 6 ,
  bitwise_xor = 1 << 7 , bitwise_not = 1 << 8 , bitwise_lshift = 1 << 9 , bitwise_rshift = 1 << 10 ,
  logical_and = 1 << 11 , logical_or = 1 << 12 , logical_not = 1 << 13 , increment = 1 << 14 ,
  decrement = 1 << 15 , convert = 1 << 16 , comparable = 1 << 17 , additive = add | subtract ,
  multiplicative = multiply | divide | modulo , bitwise_logic = bitwise_and | bitwise_or | bitwise_xor | bitwise_not , bitwise_shift = bitwise_lshift | bitwise_rshift , logic = logical_and | logical_or | logical_not
}
 Enum class for all supported operations that can be added to a seqan3::detail::strong_type. More...
 

Variables

template<typename t >
constexpr bool seqan3::add_enum_bitwise_operators = false
 Set to true for a scoped enum to have binary operators overloaded.
 
template<typename t >
constexpr bool seqan3::detail::is_type_list_of_sequence_file_input_formats_v = false
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::sequence_file_input_format [default is false].
 
template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_sequence_file_input_formats_v< type_list< ts... > >
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::sequence_file_input_format [overload].
 
template<typename t >
constexpr bool seqan3::detail::is_type_list_of_structure_file_input_formats_v = false
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_input_format [default is false].
 
template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_structure_file_input_formats_v< type_list< ts... > >
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_input_format [overload].
 
template<typename t >
constexpr bool seqan3::detail::is_type_list_of_structure_file_output_formats_v = false
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_output_format [default is false].
 
template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_structure_file_output_formats_v< type_list< ts... > >
 Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_output_format [overload].
 

Detailed Description

Provides 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.

Macro Definition Documentation

◆ SEQAN3_COMPILER_IS_GCC

#define SEQAN3_COMPILER_IS_GCC   0

Whether the current compiler is GCC.

GNUC is also used to indicate the support for GNU compiler extensions. To detect the presence of the GCC compiler, one has to rule out other compilers.

See also
https://sourceforge.net/p/predef/wiki/Compilers

◆ SEQAN3_CPO_OVERLOAD

#define SEQAN3_CPO_OVERLOAD (   ...)    cpo_overload(__VA_ARGS__) SEQAN3_CPO_OVERLOAD_BODY

A macro that helps to define a seqan3::detail::customisation_point_object.

DEV

Expands to a function definition with the name cpo_overload.

It puts the given expression via SEQAN3_CPO_OVERLOAD_BODY as a single return statement in the function body, the noexcept declaration and requires declaration.

template <typename range_t>
requires true // further constraints
static constexpr auto SEQAN3_CPO_OVERLOAD(seqan3::detail::priority_tag<1>, range_t && range)(
/*return*/ std::forward<range_t>(range).begin() /*;*/
);
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition customisation_point.hpp:104
A tag that allows controlled overload resolution via implicit base conversion rules.
Definition customisation_point.hpp:29

expands to something similar to

template <typename range_t>
requires true // further constraints
static constexpr auto cpo_overload(seqan3::detail::priority_tag<1>, range_t && range)
noexcept(noexcept(std::forward<range_t>(range).begin()))
requires requires()
{
{std::forward<range_t>(range).begin()};
}
{
return std::forward<range_t>(range).begin();
}

◆ SEQAN3_CPO_OVERLOAD_BODY

#define SEQAN3_CPO_OVERLOAD_BODY (   ...)
Value:
noexcept(auto) \
{ \
return __VA_ARGS__; \
}

A macro helper for SEQAN3_CPO_OVERLOAD.

DEV

Please note that in order to allow a semicolon at the end when using this macro, i.e.

(
...
);
#define SEQAN3_CPO_OVERLOAD_BODY(...)
A macro helper for SEQAN3_CPO_OVERLOAD.
Definition customisation_point.hpp:59

we need some expression at the end of the macro that can have a semicolon appended. We chose static_assert(true) for that reason.

Typedef Documentation

◆ all

using seqan3::detail::all = typedef seqan::stl::views::all

Returns a view that includes all elements of the range argument.

See also
https://en.cppreference.com/w/cpp/ranges/all_view

This implements the new C++20 behaviour that is only available with gcc12 and newer. In contrast to the old std::views::all, rvalue ranges can be bound.

Returns

◆ copyable_wrapper_t

Utility transformation trait to get a wrapper type that models std::copyable.

See also
https://en.cppreference.com/w/cpp/ranges/copyable_wrapper

◆ invoke_deferred_crtp_base

template<typename deferred_crtp_base_t , typename derived_t >
using seqan3::detail::invoke_deferred_crtp_base = typedef typename deferred_crtp_base_t::template invoke<derived_t>

Template alias to instantiate the deferred crtp base with the derived class.

Template Parameters
deferred_crtp_base_tThe deferred crtp base class.
derived_tThe derived type to instantiate the crtp base class with.

Effectively declares the type resulting from deferred_crtp_base_t::template invoke<derived_t>.

See also
seqan3::detail::deferred_crtp_base

◆ iter_pointer_t

template<typename it_t >
using seqan3::detail::iter_pointer_t = typedef typename iter_pointer<it_t>::type

Return the pointer type of the input type (transformation_trait shortcut).

Template Parameters
it_tThe type to operate on.
See also
seqan3::detail::iter_pointer

◆ iterator_concept_tag_t

template<typename it_t >
using seqan3::detail::iterator_concept_tag_t = typedef std::conditional_t< std::contiguous_iterator<it_t>, std::contiguous_iterator_tag, std::conditional_t<std::random_access_iterator<it_t>, std::random_access_iterator_tag, std::conditional_t<std::bidirectional_iterator<it_t>, std::bidirectional_iterator_tag, std::conditional_t<std::forward_iterator<it_t>, std::forward_iterator_tag, std::conditional_t<std::input_iterator<it_t>, std::input_iterator_tag, std::output_iterator_tag> >> >>

Exposes the iterator_concept from the modelled concept.

Template Parameters
it_tThe type to operate on.

◆ owning_view

using seqan3::detail::owning_view = typedef seqan::stl::ranges::owning_view

A move-only view that takes unique ownership of a range.

See also
https://en.cppreference.com/w/cpp/ranges/owning_view

◆ strip_type_identity_t

template<typename t >
using seqan3::detail::strip_type_identity_t = typedef std::conditional_t<is_type_specialisation_of_v<t, std::type_identity>, transformation_trait_or_t<t, void>, t>

A transformation trait shortcut that returns the type inside a std::type_identity or the type itself.

Template Parameters
tThe type to operate on.

◆ transfer_template_args_onto_t

template<typename source_type , template< typename... > typename target_template>
using seqan3::detail::transfer_template_args_onto_t = typedef typename transfer_template_args_onto<source_type, target_template>::type

Shortcut for seqan3::detail::transfer_template_args_onto (transformation_trait shortcut).

See also
seqan3::detail::transfer_template_args_onto

◆ transfer_template_vargs_onto_t

template<typename source_type , template< auto... > typename target_template>
using seqan3::detail::transfer_template_vargs_onto_t = typedef typename transfer_template_vargs_onto<source_type, target_template>::type

Shortcut for seqan3::detail::transfer_template_vargs_onto (transformation_trait shortcut).

See also
seqan3::detail::transfer_template_vargs_onto

◆ valid_template_spec_or_t

template<typename fallback_t , template< typename... > typename templ_t, typename... spec_t>
using seqan3::detail::valid_template_spec_or_t = typedef typename valid_template_spec_or<fallback_t, templ_t, spec_t...>::type

Helper for seqan3::detail::valid_template_spec_or (transformation_trait shortcut).

See also
seqan3::detail::valid_template_spec_or
Template Parameters
fallback_tThe fallback type.
templ_tThe type template that should be specialised.
spec_tThe specialisation for the type template.

Enumeration Type Documentation

◆ strong_type_skill

Enum class for all supported operations that can be added to a seqan3::detail::strong_type.

See also
seqan3::enum_bitwise_operators enables combining enum values.

Variable Documentation

◆ add_enum_bitwise_operators

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

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

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

Example

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <iostream>
enum class my_enum
{
VAL1 = 1,
VAL2 = 2,
COMB = 3
};
template <>
constexpr bool seqan3::add_enum_bitwise_operators<my_enum> = true;
int main()
{
using seqan3::operator|;
my_enum e = my_enum::VAL1;
my_enum e2 = e | my_enum::VAL2;
std::cout << std::boolalpha << (e2 == my_enum::COMB) << '\n'; // true
}
Provides seqan3::add_enum_bitwise_operators.
T boolalpha(T... args)

◆ is_type_list_of_sequence_file_input_formats_v

template<typename t >
constexpr bool seqan3::detail::is_type_list_of_sequence_file_input_formats_v = false
constexpr

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::sequence_file_input_format [default is false].

See also
seqan3::type_list_specialisationOfsequence_file_input_formats

◆ is_type_list_of_sequence_file_input_formats_v< type_list< ts... > >

template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_sequence_file_input_formats_v< type_list< ts... > >
constexpr
Initial value:
=
(sequence_file_input_format<ts> && ...)

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::sequence_file_input_format [overload].

See also
seqan3::type_list_specialisationOfsequence_file_input_formats

◆ is_type_list_of_structure_file_input_formats_v

template<typename t >
constexpr bool seqan3::detail::is_type_list_of_structure_file_input_formats_v = false
constexpr

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_input_format [default is false].

See also
seqan3::type_list_specialisationOfstructure_file_input_formats

◆ is_type_list_of_structure_file_input_formats_v< type_list< ts... > >

template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_structure_file_input_formats_v< type_list< ts... > >
constexpr
Initial value:
=
(structure_file_input_format<ts> && ...)

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_input_format [overload].

See also
seqan3::type_list_specialisationOfstructure_file_input_formats

◆ is_type_list_of_structure_file_output_formats_v

template<typename t >
constexpr bool seqan3::detail::is_type_list_of_structure_file_output_formats_v = false
constexpr

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_output_format [default is false].

See also
seqan3::type_list_specialisationOfstructure_file_output_formats

◆ is_type_list_of_structure_file_output_formats_v< type_list< ts... > >

template<typename... ts>
constexpr bool seqan3::detail::is_type_list_of_structure_file_output_formats_v< type_list< ts... > >
constexpr
Initial value:
=
(structure_file_output_format<ts> && ...)

Auxiliary value metafuncton that checks whether a type is a seqan3::type_list and all types meet seqan3::structure_file_output_format [overload].

See also
seqan3::type_list_specialisationOfstructure_file_output_formats
Hide me