SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
seqan3::align_cfg::on_result< callback_t > Class Template Reference

Configuration element to provide a user defined callback function for the alignment. More...

#include <seqan3/alignment/configuration/align_config_on_result.hpp>

+ Inheritance diagram for seqan3::align_cfg::on_result< callback_t >:

Public Member Functions

Constructors, destructor and assignment
constexpr on_result ()=default
 Defaulted.
 
constexpr on_result (on_result const &)=default
 Defaulted.
 
constexpr on_result (on_result &&)=default
 Defaulted.
 
constexpr on_resultoperator= (on_result const &)=default
 Defaulted.
 
constexpr on_resultoperator= (on_result &&)=default
 Defaulted.
 
 ~on_result ()=default
 Defaulted.
 
constexpr on_result (callback_t callback)
 Constructs the configuration element with the given user callback. More...
 

Public Attributes

seqan3::semiregular_box_t< callback_t > callback {}
 The stored callable which will be invoked with the alignment result.
 

Detailed Description

template<std::move_constructible callback_t>
class seqan3::align_cfg::on_result< callback_t >

Configuration element to provide a user defined callback function for the alignment.

Template Parameters
callback_tThe type of the callback; must model std::invocable with the generated seqan3::alignment_result and std::move_constructible.

Allows the user to specify a callback that should be called for every computed alignment result. The callback must take exactly one argument for the alignment result and return void. If the user callback is specified, the call to the alignment algorithm seqan3::align_pairwise will return nothing, i.e. it does not return a seqan3::algorithm_result_generator_range anymore. Note that within a parallel configuration the order of the generated alignment results and therefore the call to the user callback is non-deterministic. However, the continuation interface with the user callback can be more efficient in a concurrent environment. If you pass an lvalue function object as callback function, you need to make sure that the referenced function object outlives the call to the alignment algorithm.

Example

The following code snippet demonstrates the basic usage:

int main()
{
seqan3::align_cfg::on_result cfg{[] (auto && result) { seqan3::debug_stream << result << '\n'; }};
}

Constructor & Destructor Documentation

◆ on_result()

template<std::move_constructible callback_t>
constexpr seqan3::align_cfg::on_result< callback_t >::on_result ( callback_t  callback)
inlineexplicitconstexpr

Constructs the configuration element with the given user callback.

Parameters
[in]callbackThe callback to invoke for a computed seqan3::alignment_result.

The documentation for this class was generated from the following file:
debug_stream.hpp
Provides seqan3::debug_stream and related types.
align_config_on_result.hpp
Provides seqan3::align_cfg::on_result.
seqan3::align_cfg::on_result
Configuration element to provide a user defined callback function for the alignment.
Definition: align_config_on_result.hpp:55
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:42