SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
align_config_result.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 
19 
20 namespace seqan3::detail
21 {
22 
26 struct with_score_type
27 {
30  static constexpr int8_t rank = 0;
31 };
32 
36 struct with_back_coordinate_type
37 {
40  static constexpr int8_t rank = 1;
41 };
42 
46 struct with_front_coordinate_type
47 {
50  static constexpr int8_t rank = 2;
51 };
52 
57 struct with_alignment_type
58 {
61  static constexpr int8_t rank = 3;
62 };
63 
67 template <typename t>
68 struct score_type
69 {};
70 
71 } // namespace seqan3::detail
72 
73 namespace seqan3
74 {
75 
78 inline constexpr detail::with_score_type with_score{};
81 inline constexpr detail::with_back_coordinate_type with_back_coordinate{};
84 inline constexpr detail::with_front_coordinate_type with_front_coordinate{};
87 inline constexpr detail::with_alignment_type with_alignment{};
92 template <arithmetic score_t>
93 inline constexpr detail::score_type<score_t> using_score_type{};
94 
95 } // namespace seqan3
96 
97 namespace seqan3::align_cfg
98 {
99 
129 template <typename alignment_result_tag_t = detail::with_score_type, typename score_t = int32_t>
136 class result : public pipeable_config_element<result<alignment_result_tag_t, score_t>, alignment_result_tag_t>
137 {
140 public:
142  using score_type = score_t;
143 
147  constexpr result() = default;
148  constexpr result(result const &) = default;
149  constexpr result & operator=(result const &) = default;
150  constexpr result(result &&) = default;
151  constexpr result & operator=(result &&) = default;
152  ~result() = default;
153 
157  constexpr result(alignment_result_tag_t result_tag) noexcept : base_t{result_tag} {}
158 
163  constexpr result(alignment_result_tag_t result_tag,
164  detail::score_type<score_t> SEQAN3_DOXYGEN_ONLY(score_type_tag)) noexcept : base_t{result_tag} {}
166 
169  static constexpr detail::align_config_id id{detail::align_config_id::result};
170 };
171 
176 template <typename alignment_result_tag_t>
178 result(alignment_result_tag_t) -> result<alignment_result_tag_t>;
179 
181 template <typename alignment_result_tag_t, arithmetic score_t>
182 result(alignment_result_tag_t, detail::score_type<score_t>) -> result<alignment_result_tag_t, score_t>;
184 } // namespace seqan3::align_cfg
seqan3::align_cfg::result::result
constexpr result(alignment_result_tag_t result_tag) noexcept
Construction from the result feature you want to compute (e.g. seqan3::with_score).
Definition: align_config_result.hpp:157
pipeable_config_element.hpp
Provides seqan3::pipeable_config_element.
seqan3::align_cfg::result
Sets the result of the alignment computation.
Definition: align_config_result.hpp:136
same_as
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type.
seqan3::align_cfg::result::operator=
constexpr result & operator=(result const &)=default
Defaulted.
core_language.hpp
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
seqan3::align_cfg::result::result
constexpr result(alignment_result_tag_t result_tag, detail::score_type< score_t > score_type_tag) noexcept
Construction from the result feature you want to compute (e.g. seqan3::with_score).
Definition: align_config_result.hpp:163
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
seqan3::align_cfg
A special sub namespace for the alignment configurations.
Definition: align_config_aligned_ends.hpp:514
seqan3::pipeable_config_element
Adds pipe interface to configuration elements.
Definition: pipeable_config_element.hpp:30
alignment_result.hpp
Provides seqan3::alignment_result.
seqan3::align_cfg::result::score_type
score_t score_type
The score type of the alignment result.
Definition: align_config_result.hpp:142
seqan3::align_cfg::result::~result
~result()=default
Defaulted.
seqan3::align_cfg::result::result
constexpr result()=default
Defaulted.
detail.hpp
Provides some utility functions for the alignment configurations.