SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
on_result.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <type_traits>
13
17
18namespace seqan3::search_cfg
19{
20
50template <std::copy_constructible callback_t>
52{
53public:
55 seqan3::detail::copyable_wrapper_t<callback_t> callback; // Allows lambdas with capture blocks.
56
60 constexpr on_result() = default;
61 constexpr on_result(on_result const &) = default;
62 constexpr on_result(on_result &&) = default;
63 constexpr on_result & operator=(on_result const &) = default;
64 constexpr on_result & operator=(on_result &&) = default;
65 ~on_result() = default;
66
70 constexpr explicit on_result(callback_t && callback) : callback{std::forward<callback_t>(callback)}
71 {}
73
77};
78
83template <std::copy_constructible callback_t>
86} // namespace seqan3::search_cfg
Utility wrapper that behaves like std::optional but makes the type conform with the std::copyable con...
Definition copyable_wrapper.hpp:34
Configuration element to provide a user defined callback function for the search.
Definition on_result.hpp:52
constexpr on_result & operator=(on_result const &)=default
Defaulted.
constexpr on_result(callback_t &&callback)
Constructs the configuration element with the given user callback.
Definition on_result.hpp:70
constexpr on_result()=default
Defaulted.
constexpr on_result(on_result &&)=default
Defaulted.
constexpr on_result(on_result const &)=default
Defaulted.
seqan3::detail::copyable_wrapper_t< callback_t > callback
The stored callable which will be invoked with the search result.
Definition on_result.hpp:55
~on_result()=default
Defaulted.
constexpr on_result & operator=(on_result &&)=default
Defaulted.
Provides seqan3::detail::copyable_wrapper.
search_config_id
Specifies an id for every configuration element.
Definition search/configuration/detail.hpp:40
@ on_result
Identifier for the configuration to pass a user defined callable.
A special sub namespace for the search configurations.
SeqAn specific customisations in the standard namespace.
Provides seqan3::pipeable_config_element.
Provides compatibility matrix for search configurations.
Adds pipe interface to configuration elements.
Definition pipeable_config_element.hpp:29
Hide me