siplasplas
A library for C++ reflection and introspection
cpp::SyncSink Class Reference

Implements a direct connection to the destination function. More...

#include <siplasplas/signals/syncsink.hpp>

Inheritance diagram for cpp::SyncSink:
cpp::SignalSink

Public Member Functions

template<typename Caller , typename Function >
 SyncSink (Caller &caller, Function function)
 Creates a synchronous sink given a caller and a destination function. More...
 
template<typename Caller , typename Callee , typename Function >
 SyncSink (Caller &caller, Callee &callee, Function function)
 Creates a synchronous sink given a caller, a callee, and a destination function. More...
 
bool pull () override
 Does nothing. More...
 
- Public Member Functions inherited from cpp::SignalSink
template<typename Caller , typename Callee >
 SignalSink (Caller &caller, Callee &callee)
 Constructs a sink given the connection caller and the callee. More...
 
template<typename Caller >
 SignalSink (Caller &caller)
 Constructs a sink given the connection caller object. More...
 
template<typename... Args>
void operator() (Args &&...args)
 Invokes the sink with the given arguments. More...
 
SignalEmitter * callee () const
 Gives the callee of the connection. More...
 
SignalEmitter * caller () const
 Gives the caller of the connection. More...
 

Protected Member Functions

void invoke (const std::vector< cpp::dynamic_reflection::Object > &args) override
 
bool invokeWithoutCallee () const override
 

Detailed Description

Implements a direct connection to the destination function.

Synchronous sinks have no special policy for function invocation but just invoke the function directly when a signal arrives. See SignalEmitter::connect().

Constructor & Destructor Documentation

template<typename Caller , typename Function >
cpp::SyncSink::SyncSink ( Caller &  caller,
Function  function 
)
inline

Creates a synchronous sink given a caller and a destination function.

See SignalEmitter::connect_async()

Parameters
callerCaller object.
functionFunction to be invoked when the signal is handled.
template<typename Caller , typename Callee , typename Function >
cpp::SyncSink::SyncSink ( Caller &  caller,
Callee &  callee,
Function  function 
)
inline

Creates a synchronous sink given a caller, a callee, and a destination function.

See SignalEmitter::connect_async()

Parameters
callerCaller object.
calleeCallee object.
functionFunction to be invoked when the signal is handled.

Member Function Documentation

bool cpp::SyncSink::pull ( )
overridevirtual

Does nothing.

Synchronous sinks directly invoke the destination function when SignalSink::operator() and SyncSink::invoke() are invoked, so pull() has no work to do.

Returns
Always returns true.

Implements cpp::SignalSink.


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