Loading...
Searching...
No Matches
cereal.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 <type_traits>
#include <seqan3/core/platform.hpp>
#if SEQAN3_HAS_CEREAL
# include <cereal/archives/binary.hpp>
# include <cereal/details/traits.hpp>
#endif // SEQAN3_HAS_CEREAL
namespace seqan3
{
#if SEQAN3_HAS_CEREAL
template <typename t>
concept cereal_output_archive = std::is_base_of_v<cereal::detail::OutputArchiveBase, t>;
#else
template <typename t>
concept cereal_output_archive = false;
#endif // SEQAN3_HAS_CEREAL
#if SEQAN3_HAS_CEREAL
template <typename t>
concept cereal_input_archive = std::is_base_of_v<cereal::detail::InputArchiveBase, t>;
#else
template <typename t>
concept cereal_input_archive = false;
#endif // SEQAN3_HAS_CEREAL
#if SEQAN3_HAS_CEREAL
template <typename t>
concept cereal_archive = cereal_output_archive<t> || cereal_input_archive<t>;
#else
template <typename t>
concept cereal_archive = false;
#endif // SEQAN3_HAS_CEREAL
#if SEQAN3_HAS_CEREAL
template <typename t>
concept cereal_text_archive = std::is_base_of_v<cereal::traits::TextArchive, t>;
#else
template <typename t>
concept cereal_text_archive = false;
#endif // SEQAN3_HAS_CEREAL
#if SEQAN3_HAS_CEREAL
template <typename value_t,
typename input_archive_t = cereal::BinaryInputArchive,
typename output_archive_t = cereal::BinaryOutputArchive>
concept cerealisable = cereal::traits::is_input_serializable<value_t, input_archive_t>::value
&& cereal::traits::is_output_serializable<value_t, output_archive_t>::value;
#else
template <typename value_t, typename input_archive_t = void, typename output_archive_t = void>
concept cerealisable = false;
#endif // SEQAN3_HAS_CEREAL
} // namespace seqan3
namespace seqan3::detail
{
#if SEQAN3_HAS_CEREAL
template <typename type>
using strip_cereal_wrapper_t = typename cereal::traits::strip_minimal<std::decay_t<type>>::type;
#else
template <typename type>
using strip_cereal_wrapper_t = type;
#endif // SEQAN3_HAS_CEREAL
} // namespace seqan3::detail
cereal_archive
All archives of the Cereal library satisfy this.
cereal_input_archive
All input archives of the Cereal library satisfy this.
cereal_output_archive
All output archives of the Cereal library satisfy this.
cereal_text_archive
All text archives of the Cereal library satisfy this.
cerealisable
Specifies the requirements for types that are serialisable via Cereal.
std::is_base_of_v
T is_base_of_v
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
platform.hpp
Provides platform and dependency checks.
type_traits
Hide me