Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Input management abstraction for the graph. More...
#include "graph_inputs_management_abstraction.h"
Public Types | |
using | inputs_t = std::tuple< Inputs... > |
Accessor to the graph's inputs. | |
Public Member Functions | |
GraphInputsManagementAbstraction () | |
Default constructor. | |
~GraphInputsManagementAbstraction () override=default | |
Default destructor. | |
void | wakeUp () override |
Graph wake up, wakes up all registered slots of the input node. | |
bool | wait () |
Wait for the graph, should not be called a graph does not wait ! | |
![]() | |
SlotAbstraction (std::shared_ptr< implementor::ImplementorSlot > concreteSlot) | |
Constructor using a concrete slot implementation. | |
virtual | ~SlotAbstraction ()=default |
Default destructor. | |
std::set< SlotAbstraction * > const & | slots () const |
Const accessor to slots. | |
std::set< SlotAbstraction * > & | slots () |
Accessor to slots. | |
std::set< NotifierAbstraction * > const & | connectedNotifiers () const |
Accessor to the NotifierAbstraction attached to this slot, protected with mutex. | |
void | addNotifier (NotifierAbstraction *const notifier) |
Add a NotifierAbstraction to this slot. | |
void | removeNotifier (NotifierAbstraction *const notifier) |
Remove a NotifierAbstraction to this slot. | |
virtual void | wakeUp ()=0 |
Wake up mechanism, called to notify the std::condition_variable. | |
bool | hasNotifierConnected () const |
Test if there is at least one notifier connected. | |
void | lockSlotMutex () |
Lock mutex. | |
void | unlockSlotMutex () |
Unlock mutex. | |
![]() | |
ReceiverAbstraction (std::shared_ptr< implementor::ImplementorReceiver< Inputs > > 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< Inputs > * > const & | connectedSenders () const |
Accessor to the senders attached to this receiver. | |
void | receive (std::shared_ptr< Inputs > const inputData) |
Receive a piece of data. | |
std::shared_ptr< Inputs > | 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< Inputs > *const sender) |
Add a SenderAbstraction to the concrete receiver implementation. | |
void | removeSender (SenderAbstraction< Inputs > *const sender) |
Remove a SenderAbstraction to the concrete receiver implementation. | |
void | printEdgeInformation (Printer *printer) |
Add to the printer the edge information. | |
Protected Member Functions | |
std::unique_ptr< GraphSource< Inputs... > > const & | source () const |
Source accessor. | |
void | terminateSource () |
Terminate a source, notify all input nodes to terminate. | |
template<class InputDataType > | |
void | addInputNodeToGraph (NodeAbstraction *const inputNode) |
Add an input node to a graph. | |
void | disconnectSource () |
Disconnect the source when the graph is set as inside. | |
template<class Input > | |
void | sendInputDataToSource (std::shared_ptr< Input > data) |
Send a data to the source. | |
void | printSource (Printer *printer) |
Gather source information. | |
void | duplicateSourceEdges (GraphInputsManagementAbstraction< Inputs... > const &rhs, std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping) |
Duplicate source edges. | |
![]() | |
std::shared_ptr< std::mutex > const & | mutex () const |
Protected accessor to mutex. | |
std::shared_ptr< std::condition_variable > const & | slotConditionVariable () const |
Protected accessor to condition variable. | |
void | copyInnerStructure (SlotAbstraction *copyableCore) |
Copy the inner structure of copyableCore into this. | |
![]() | |
void | copyInnerStructure (ReceiverAbstraction< Inputs > *copyableCore) |
Copy inner structure of the receiver to this one. | |
Private Member Functions | |
template<class Input > | |
void | disconnectSourceFromReceiver () |
Disconnect the source from the input node receivers. | |
template<class Input > | |
void | duplicateSourceEdge (GraphInputsManagementAbstraction< Inputs... > const &rhs, std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &correspondenceMap) |
Duplicate source edge for a type. | |
Private Attributes | |
std::unique_ptr< GraphSource< Inputs... > > | source_ = nullptr |
Graph's source. | |
Input management abstraction for the graph.
Inputs | Types of input data |
Definition at line 48 of file graph_inputs_management_abstraction.h.
using hh::core::abstraction::GraphInputsManagementAbstraction< Inputs >::inputs_t = std::tuple<Inputs...> |
Accessor to the graph's inputs.
Definition at line 55 of file graph_inputs_management_abstraction.h.
|
inline |
Default constructor.
Definition at line 58 of file graph_inputs_management_abstraction.h.
|
overridedefault |
Default destructor.
|
inlineprotected |
Add an input node to a graph.
InputDataType | Input data type |
inputNode | Node to add as input of the graph for the type InputDataType |
Definition at line 98 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Disconnect the source when the graph is set as inside.
Definition at line 128 of file graph_inputs_management_abstraction.h.
|
inlineprivate |
Disconnect the source from the input node receivers.
Input | Type of input node receivers to disconnect from the source |
Definition at line 170 of file graph_inputs_management_abstraction.h.
|
inlineprivate |
Duplicate source edge for a type.
Input | Type of input node receivers to duplicate |
rhs | Graph input to copy the source edges from |
correspondenceMap | Map from node to its clone |
Definition at line 188 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Duplicate source edges.
rhs | Graph input to copy the source edges from |
mapping | Map from node to its clone |
Definition at line 161 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Gather source information.
printer | Visitor printer gathering source information |
Definition at line 152 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Send a data to the source.
Input | Type of the input data |
data | Data of type Input |
Definition at line 148 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Source accessor.
Definition at line 89 of file graph_inputs_management_abstraction.h.
|
inlineprotected |
Terminate a source, notify all input nodes to terminate.
Definition at line 92 of file graph_inputs_management_abstraction.h.
|
inline |
Wait for the graph, should not be called a graph does not wait !
std::runtime_error | Il all cases, a graph can not wait |
Definition at line 84 of file graph_inputs_management_abstraction.h.
|
inlineoverridevirtual |
Graph wake up, wakes up all registered slots of the input node.
Implements hh::core::abstraction::SlotAbstraction.
Definition at line 75 of file graph_inputs_management_abstraction.h.
|
private |
Graph's source.
Definition at line 52 of file graph_inputs_management_abstraction.h.