SeqAn3 3.3.0-rc.1
The Modern C++ library for sequence analysis.
on_result.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2022, 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
20
21namespace seqan3::search_cfg
22{
23
53template <std::copy_constructible callback_t>
55{
56public:
58 seqan3::detail::copyable_wrapper_t<callback_t> callback{}; // Allows lambdas with capture blocks.
59
63 constexpr on_result() = default;
64 constexpr on_result(on_result const &) = default;
65 constexpr on_result(on_result &&) = default;
66 constexpr on_result & operator=(on_result const &) = default;
67 constexpr on_result & operator=(on_result &&) = default;
68 ~on_result() = default;
69
73 constexpr explicit on_result(callback_t && callback) : callback{std::forward<callback_t>(callback)}
74 {}
76
80};
81
86template <std::copy_constructible callback_t>
89} // 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:37
Configuration element to provide a user defined callback function for the search.
Definition: on_result.hpp:55
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:73
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:58
~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: detail.hpp:43
@ on_result
Identifier for the configuration to pass a user defined callable.
A special sub namespace for the search configurations.
on_result(callback_t &&) -> on_result< std::decay_t< callback_t > >
Deduces the callback type from a forwarding constructor argument.
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:32