SeqAn3 3.1.0
The Modern C++ library for sequence analysis.
cereal.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6// -----------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <type_traits>
16
18
19#if SEQAN3_WITH_CEREAL
20#include <cereal/details/traits.hpp>
21#include <cereal/archives/binary.hpp>
22#endif
23
24namespace seqan3
25{
26
41#if SEQAN3_WITH_CEREAL
42template <typename t>
43SEQAN3_CONCEPT cereal_output_archive = std::is_base_of_v<cereal::detail::OutputArchiveBase, t>;
44#else
45template <typename t>
46SEQAN3_CONCEPT cereal_output_archive = false;
47#endif
49
64#if SEQAN3_WITH_CEREAL
65template <typename t>
66SEQAN3_CONCEPT cereal_input_archive = std::is_base_of_v<cereal::detail::InputArchiveBase, t>;
67#else
68template <typename t>
69SEQAN3_CONCEPT cereal_input_archive = false;
70#endif
72
83#if SEQAN3_WITH_CEREAL
84template <typename t>
86#else
87template <typename t>
88SEQAN3_CONCEPT cereal_archive = false;
89#endif
91
106#if SEQAN3_WITH_CEREAL
107template <typename t>
108SEQAN3_CONCEPT cereal_text_archive = std::is_base_of_v<cereal::traits::TextArchive, t>;
109#else
110template <typename t>
111SEQAN3_CONCEPT cereal_text_archive = false;
112#endif
114
148#if SEQAN3_WITH_CEREAL
149template <typename value_t,
150 typename input_archive_t = cereal::BinaryInputArchive,
151 typename output_archive_t = cereal::BinaryOutputArchive>
152SEQAN3_CONCEPT cerealisable =
153 cereal::traits::is_input_serializable<value_t, input_archive_t>::value &&
154 cereal::traits::is_output_serializable<value_t, output_archive_t>::value;
155#else
156template <typename value_t,
157 typename input_archive_t = void,
158 typename output_archive_t = void>
159SEQAN3_CONCEPT cerealisable = false;
160#endif
162
163} // namespace seqan3
164
165namespace seqan3::detail
166{
167
172#if SEQAN3_WITH_CEREAL
173template <typename type>
174using strip_cereal_wrapper_t = typename cereal::traits::strip_minimal<std::decay_t<type>>::type;
175#else
176template <typename type>
177using strip_cereal_wrapper_t = type;
178#endif
179
180} // namespace seqan3::detail
All archives of the Cereal library satisfy this.
All input archives of the Cereal library satisfy this.
All output archives of the Cereal library satisfy this.
All text archives of the Cereal library satisfy this.
Specifies the requirements for types that are serialisable via Cereal.
The main SeqAn3 namespace.
Definition: cigar_operation_table.hpp:2
Provides platform and dependency checks.