SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
output_format_concept.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 <fstream>
16 #include <string>
17 #include <vector>
18 
24 
25 namespace seqan3::detail
26 {
27 
29 template <typename t>
30 class sequence_file_output_format
31 {};
32 
33 } // namespace seqan3::detail
34 
35 namespace seqan3
36 {
37 
48 template <typename t>
50 SEQAN3_CONCEPT SequenceFileOutputFormat = requires (detail::sequence_file_output_format<t> & v,
51  std::ofstream & f,
52  sequence_file_output_options & options,
53  dna5_vector & seq,
54  std::string & id,
55  std::vector<phred42> & qual,
56  std::vector<dna5q> & seq_qual)
57 {
58  t::file_extensions;
59 
60  { v.write(f, options, seq, id, qual) } -> void;
61  { v.write(f, options, std::ignore, id, std::ignore) } -> void;
62  { v.write(f, options, std::ignore, std::ignore, std::ignore) } -> void;
63  // the last is required to be compile time valid, but should always throw at run-time.
64 };
66 
102 
104 } // namespace seqan3
105 
106 namespace seqan3::detail
107 {
108 
114 template <typename t>
115 constexpr bool is_type_list_of_sequence_file_output_formats_v = false;
116 
122 template <typename ... ts>
123 constexpr bool is_type_list_of_sequence_file_output_formats_v<type_list<ts...>> =
124  (SequenceFileOutputFormat<ts> && ...);
125 
130 template <typename t>
131 SEQAN3_CONCEPT TypeListOfSequenceFileOutputFormats = is_type_list_of_sequence_file_output_formats_v<t>;
132 } // namespace seqan3::detail
constexpr sequenced_policy seq
Global execution policy object for sequenced execution policy.
Definition: execution.hpp:54
The main SeqAn3 namespace.
Provides seqan3::dna5, container aliases and string literals.
Provides seqan3::sequence_file_output_options.
Provides seqan3::type_list and auxiliary type traits.
Definition: aligned_sequence_concept.hpp:35
Provides seqan3::phred42 quality scores.
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:27
Provides aliases for qualified.