Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Core's abstraction to receive a piece of data. More...
#include "receiver_abstraction.h"
Public Member Functions | |
ReceiverAbstraction (std::shared_ptr< implementor::ImplementorReceiver< Input > > concreteReceiver, std::shared_ptr< std::mutex > slotMutex) | |
Constructor using a concrete implementation of a receiver implementor, and the mutex from the slot. | |
virtual | ~ReceiverAbstraction ()=default |
Default destructor. | |
std::set< ReceiverAbstraction * > const & | receivers () const |
Const accessor to receivers. | |
std::set< ReceiverAbstraction * > & | receivers () |
Accessor to receivers. | |
std::set< SenderAbstraction< Input > * > const & | connectedSenders () const |
Accessor to the senders attached to this receiver. | |
void | receive (std::shared_ptr< Input > const inputData) |
Receive a piece of data. | |
std::shared_ptr< Input > | getInputData () |
Get an input data from the concrete receiver implementation. | |
size_t | numberElementsReceived () const |
Accessor to the current number of input data received and waiting to be processed. | |
size_t | maxNumberElementsReceived () const |
Accessor to the maximum number of input data received and waiting to be processed. | |
bool | empty () const |
Test if the receiver is empty. | |
void | addSender (SenderAbstraction< Input > *const sender) |
Add a SenderAbstraction to the concrete receiver implementation. | |
void | removeSender (SenderAbstraction< Input > *const sender) |
Remove a SenderAbstraction to the concrete receiver implementation. | |
void | printEdgeInformation (Printer *printer) |
Add to the printer the edge information. | |
Protected Member Functions | |
void | copyInnerStructure (ReceiverAbstraction< Input > *copyableCore) |
Copy inner structure of the receiver to this one. | |
Private Attributes | |
std::shared_ptr< implementor::ImplementorReceiver< Input > > | concreteReceiver_ = nullptr |
Concrete implementation of the interface. | |
std::shared_ptr< std::mutex > const | slotMutex_ = nullptr |
Mutex shared from the slot abstraction. | |
Core's abstraction to receive a piece of data.
Input | Type of data received by the abstraction |
Definition at line 61 of file receiver_abstraction.h.
|
inlineexplicit |
Constructor using a concrete implementation of a receiver implementor, and the mutex from the slot.
concreteReceiver | Concrete implementation of the ImplementorReceiver |
slotMutex | Mutex from the slot |
Definition at line 73 of file receiver_abstraction.h.
|
virtualdefault |
Default destructor.
|
inline |
Add a SenderAbstraction to the concrete receiver implementation.
sender | SenderAbstraction to add |
Definition at line 130 of file receiver_abstraction.h.
|
inline |
Accessor to the senders attached to this receiver.
Definition at line 98 of file receiver_abstraction.h.
|
inlineprotected |
Copy inner structure of the receiver to this one.
copyableCore | ReceiverAbstraction to copy into this |
Definition at line 164 of file receiver_abstraction.h.
|
inline |
Test if the receiver is empty.
Definition at line 126 of file receiver_abstraction.h.
|
inline |
Get an input data from the concrete receiver implementation.
Definition at line 114 of file receiver_abstraction.h.
|
inline |
Accessor to the maximum number of input data received and waiting to be processed.
Definition at line 122 of file receiver_abstraction.h.
|
inline |
Accessor to the current number of input data received and waiting to be processed.
Definition at line 118 of file receiver_abstraction.h.
|
inline |
Add to the printer the edge information.
printer | Printer used to gather information |
std::runtime_error | If the current node is not a NodeAbstraction, if a sender is not a NodeAbstraction |
Definition at line 139 of file receiver_abstraction.h.
|
inline |
Receive a piece of data.
Receive a piece of data and transmit it to the concrete receiver implementation. The call to the concrete receiver is protected via the mutex
inputData | Data to transmit to the implementation |
Definition at line 106 of file receiver_abstraction.h.
|
inline |
Accessor to receivers.
Present the receivers linked to this abstraction, usually one, may be multiple for the graph presenting all of the input node receivers
Definition at line 94 of file receiver_abstraction.h.
|
inline |
Const accessor to receivers.
Present the receivers linked to this abstraction, usually one, may be multiple for the graph presenting all of the input node receivers
Definition at line 88 of file receiver_abstraction.h.
|
inline |
Remove a SenderAbstraction to the concrete receiver implementation.
sender | SenderAbstraction to remove |
Definition at line 134 of file receiver_abstraction.h.
|
private |
Concrete implementation of the interface.
Definition at line 64 of file receiver_abstraction.h.
|
private |
Mutex shared from the slot abstraction.
Definition at line 67 of file receiver_abstraction.h.