Loading...
Searching...
No Matches
alphabet/composite/detail.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/alphabet/concept.hpp>
#include <seqan3/alphabet/detail/concept.hpp>
#include <seqan3/utility/concept.hpp>
#include <seqan3/utility/type_list/type_list.hpp>
#include <seqan3/utility/type_traits/lazy_conditional.hpp>
namespace seqan3::detail
{
// ------------------------------------------------------------------
// alphabet_tuple_like
// ------------------------------------------------------------------
template <typename t>
concept alphabet_tuple_like = requires { requires t::seqan3_alphabet_tuple_like; };
// ------------------------------------------------------------------
// required_types
// ------------------------------------------------------------------
template <typename t>
struct required_types
{
using type = type_list<>;
};
template <typename t>
requires requires { typename t::seqan3_required_types; }
struct required_types<t>
{
using type = typename t::seqan3_required_types;
};
template <typename t>
using required_types_t = typename required_types<t>::type;
// ------------------------------------------------------------------
// recursive_required_types
// ------------------------------------------------------------------
//TODO: This can be replaced with metaprogramming magic once a few more functions land in list_traits.
template <typename t>
struct recursive_required_types
{
using type = type_list<>;
};
template <typename t>
requires requires { typename t::seqan3_recursive_required_types; }
struct recursive_required_types<t>
{
using type = typename t::seqan3_recursive_required_types;
};
template <typename t>
using recursive_required_types_t = typename recursive_required_types<t>::type;
// ------------------------------------------------------------------
// Callable concept helpers for meta::invoke
// ------------------------------------------------------------------
template <typename T>
struct constructible_from
{
template <typename type>
using invoke = std::integral_constant<bool, std::is_constructible_v<type, T>>;
};
template <typename T>
struct implicitly_convertible_from
{
template <typename type>
using invoke = std::integral_constant<bool, implicitly_convertible_to<T, type>>;
};
template <typename T>
struct assignable_from
{
template <typename type>
using invoke = std::integral_constant<bool, weakly_assignable_from<type, T>>;
};
template <typename T>
struct weakly_equality_comparable_with_
{
template <typename type>
using invoke = std::integral_constant<bool, weakly_equality_comparable_with<type, T>>;
};
template <typename T>
struct weakly_ordered_with_
{
template <typename type>
using invoke = std::integral_constant<bool, weakly_ordered_with<type, T>>;
};
// ------------------------------------------------------------------
// Concept traits helper
// ------------------------------------------------------------------
template <typename lhs_t, typename rhs_t>
struct weakly_equality_comparable_with_trait :
std::integral_constant<bool, weakly_equality_comparable_with<lhs_t, rhs_t>>
{};
template <typename lhs_t, typename rhs_t>
struct weakly_ordered_with_trait : std::integral_constant<bool, weakly_ordered_with<lhs_t, rhs_t>>
{};
} // namespace seqan3::detail
// ------------------------------------------------------------------
// Forwards
// ------------------------------------------------------------------
namespace seqan3
{
// forward
template <typename... alternative_types>
requires (detail::writable_constexpr_alphabet<alternative_types> && ...) && (std::regular<alternative_types> && ...)
&& (sizeof...(alternative_types) >= 2)
class alphabet_variant;
template <typename derived_type, typename... component_types>
requires (detail::writable_constexpr_semialphabet<component_types> && ...) && (std::regular<component_types> && ...)
class alphabet_tuple_base;
} // namespace seqan3
concept.hpp
Core alphabet concept and free function/type trait wrappers.
concept.hpp
Provides alphabet helper concepts.
seqan3::alphabet_tuple_base
The CRTP base for a combined alphabet that contains multiple values of different alphabets at the sam...
Definition alphabet_tuple_base.hpp:113
seqan3::alphabet_variant
A combined alphabet that can hold values of either of its alternatives..
Definition alphabet_variant.hpp:127
lazy_conditional.hpp
Provides lazy template instantiation traits.
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
type_list.hpp
Provides seqan3::type_list.
concept.hpp
Provides concepts that do not have equivalents in C++20.
Hide me