MeVisLab Toolbox Reference
asio::ProcessorConnection< ParameterPack< Args... > > Class Template Reference

Templated implementation of the asio::Connection interface for the connection of suitable processors. More...

#include <ProcessorConnection.h>

Inheritance diagram for asio::ProcessorConnection< ParameterPack< Args... > >:
asio::Connection

Public Types

using Source = Observable< Args... >
 
using Target = Executable< Args... >
 

Public Member Functions

 ProcessorConnection ()=default
 
 ProcessorConnection (std::shared_ptr< Source > source, std::shared_ptr< Target > target, std::unique_ptr< ExecutionPolicy > execution_policy, bool mute_until_target_execution_finished=false)
 
void suspend () override
 
void resume () override
 
- Public Member Functions inherited from asio::Connection
virtual ~Connection ()=default
 

Detailed Description

template<typename... Args>
class asio::ProcessorConnection< ParameterPack< Args... > >

Templated implementation of the asio::Connection interface for the connection of suitable processors.

Synopsis:

class Consumer : public asio::Executable<int>
{
public:
Consumer()
{}
std::vector<int> history;
private:
void execute(const int& value) override
{
history.push_back(value);
}
};
using Producer = asio::Observable<int>;
// Usage:
auto source = std::make_shared<Producer>();
auto target = std::make_shared<Consumer>();
{
asio::ProcessorConnection<Consumer::Signature> connection(source, target, asio::make_unique<asio::SynchronousExecution>());
source->signal(42);
ASSERT_EQ(target->history.size(), 1);
ASSERT_EQ(target->history[0], 42);
}
source->signal(13);
ASSERT_EQ(target->history.size(), 1);
boost::graph_traits< ml_graph_ptr >::vertex_descriptor source(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for u of the edge (u,v) represented by e.
boost::graph_traits< ml_graph_ptr >::vertex_descriptor target(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for v of the edge (u,v) represented by e.

Definition at line 61 of file ProcessorConnection.h.

Member Typedef Documentation

◆ Source

template<typename... Args>
using asio::ProcessorConnection< ParameterPack< Args... > >::Source = Observable<Args...>

Definition at line 65 of file ProcessorConnection.h.

◆ Target

template<typename... Args>
using asio::ProcessorConnection< ParameterPack< Args... > >::Target = Executable<Args...>

Definition at line 66 of file ProcessorConnection.h.

Constructor & Destructor Documentation

◆ ProcessorConnection() [1/2]

template<typename... Args>
asio::ProcessorConnection< ParameterPack< Args... > >::ProcessorConnection ( )
default

◆ ProcessorConnection() [2/2]

template<typename... Args>
asio::ProcessorConnection< ParameterPack< Args... > >::ProcessorConnection ( std::shared_ptr< Source source,
std::shared_ptr< Target target,
std::unique_ptr< ExecutionPolicy execution_policy,
bool  mute_until_target_execution_finished = false 
)
inline

Definition at line 70 of file ProcessorConnection.h.

References boost::source(), and boost::target().

Member Function Documentation

◆ resume()

template<typename... Args>
void asio::ProcessorConnection< ParameterPack< Args... > >::resume ( )
inlineoverridevirtual

Implements asio::Connection.

Definition at line 113 of file ProcessorConnection.h.

◆ suspend()

template<typename... Args>
void asio::ProcessorConnection< ParameterPack< Args... > >::suspend ( )
inlineoverridevirtual

Implements asio::Connection.

Definition at line 108 of file ProcessorConnection.h.


The documentation for this class was generated from the following file: