SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Template for range adaptor closure objects that store arguments and wrap a proto-adaptor. More...
#include <seqan3/core/range/detail/adaptor_from_functor.hpp>
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | adaptor_from_functor ()=default |
Defaulted. | |
constexpr | adaptor_from_functor (adaptor_from_functor const &) noexcept=default |
Defaulted. | |
constexpr | adaptor_from_functor (adaptor_from_functor &&) noexcept=default |
Defaulted. | |
constexpr adaptor_from_functor & | operator= (adaptor_from_functor const &) noexcept=default |
Defaulted. | |
constexpr adaptor_from_functor & | operator= (adaptor_from_functor &&) noexcept=default |
Defaulted. | |
~adaptor_from_functor () noexcept=default | |
Defaulted. | |
constexpr | adaptor_from_functor (functor_type f, stored_args_ts... args) |
Construct from functor and possibly arguments. | |
Public Member Functions inherited from seqan3::detail::adaptor_base< adaptor_from_functor< functor_type, stored_args_ts... >, stored_args_ts... > | |
constexpr auto | operator() (urng_t &&urange) && |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
constexpr auto | operator() (urng_t &&urange) const & |
Function-style overload for ranges. | |
constexpr | adaptor_base (adaptor_base const &) noexcept=default |
Defaulted. | |
constexpr | adaptor_base (adaptor_base &&) noexcept=default |
Defaulted. | |
constexpr | adaptor_base (stored_args_ts... args) noexcept(noexcept(std::tuple< stored_args_ts... >{ std::forward< stored_args_ts >(args)...})) |
Constructor with possible arguments; becomes a default constructor for adaptors without args. | |
constexpr adaptor_base & | operator= (adaptor_base const &) noexcept=default |
Defaulted. | |
constexpr adaptor_base & | operator= (adaptor_base &&) noexcept=default |
Defaulted. | |
~adaptor_base () noexcept=default | |
Defaulted. | |
Private Types | |
using | base_type = adaptor_base< adaptor_from_functor< functor_type, stored_args_ts... >, stored_args_ts... > |
Type of the CRTP-base. | |
Private Member Functions | |
template<std::ranges::input_range urng_t> | |
constexpr auto | impl (urng_t &&urange, stored_args_ts... args) const |
Delegate the range argument and stored arguments to the wrapped functor. | |
Private Attributes | |
friend | base_type |
Befriend the base class so it can call impl(). | |
functor_type | fun |
The stored functor, usually a "proto-adaptor". | |
Template for range adaptor closure objects that store arguments and wrap a proto-adaptor.
functor_type | Type of the proto-adaptor functor. |
stored_args_ts | Types of the stored arguments. |
This template is particularly useful in combination with range adaptor objects that are not closure objects (a.k.a. proto adaptors). These objects take other parameters in addition to the range parameter that they might need to store in which case they can return an object of this type with the stored arguments.
This template delegates back to the proto adaptor for handling range input (impl() calls operator() of the proto-adaptor).
From include/seqan3/search/views/kmer_hash.hpp:
This is the full proto-adaptor, first look at the second member function: it handles range and argument input and delegates to the view's constructor. In other, simpler cases you could invoke other adaptors here.
And it provides an operator()
that takes only the argument and returns a range adaptor closure object with the argument wrapped (first member function). The proto-adaptor is passed to the closure object, as well, so that the proto-adaptor's operator()
can be used for handling range input.
Note that the proto-adaptor does not provide operator|
, this is only required of adaptor closure objects.
|
inlineconstexprprivate |
Delegate the range argument and stored arguments to the wrapped functor.
urng_t | The underlying range type. |
stored_args_ts | The arguments to the view (this first one will be a range, the rest is optional). |
[in] | urange | The underling range. |
[in] | args | The arguments to the constructor. |