Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Input management abstraction for the execution pipeline. More...
#include "execution_pipeline_inputs_management_abstraction.h"
Public Member Functions | |
template<class ExecutionPipelineImplementation > requires std::is_base_of_v<behavior::MultiSwitchRules<Inputs...>, ExecutionPipelineImplementation> | |
ExecutionPipelineInputsManagementAbstraction (ExecutionPipelineImplementation *const executionPipeline) | |
Construct an Input management abstraction for the execution pipeline from an implementation of MultiSwitchRules. | |
~ExecutionPipelineInputsManagementAbstraction () override=default | |
Default destructor. | |
![]() | |
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 Types | |
using | inputs_t = std::tuple< Inputs... > |
Accessor to inputs data. | |
Protected Member Functions | |
CoreSwitch< Inputs... > * | coreSwitch () const |
Accessor to the switch core. | |
template<tool::ContainsConcept< Inputs... > Input> | |
bool | callSendToGraph (std::shared_ptr< Input > &data, size_t const &graphId) |
Interface to the user-defined switch rule. | |
bool | receiversEmpty () const |
Test if the receivers are empty. | |
void | connectGraphToSwitch (std::shared_ptr< GraphInputsManagementAbstraction< Inputs... > > const graph) |
Connect a graph to the switch. | |
void | disconnectSwitch () |
Disconnect the switch from all of the graphs. | |
void | wakeUp () override |
Wake up implementation (notify one node waiting on the condition variable) | |
bool | canTerminate (bool lock) |
Can terminate implementation. | |
bool | wait () |
Wait statement when the node is alive and no input data are available. | |
void | printEdgesInformation (Printer *printer) |
Visitor for the execution pipeline edge. | |
![]() | |
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 | connectInputGraphForAType (std::shared_ptr< GraphInputsManagementAbstraction< Inputs... > > const graph) |
Connect a graph to the switch for the type Input. | |
Private Attributes | |
std::unique_ptr< CoreSwitch< Inputs... > > | coreSwitch_ = nullptr |
Core switch used to call user-defined rules. | |
Input management abstraction for the execution pipeline.
Inputs | Types of input data |
Definition at line 40 of file execution_pipeline_inputs_management_abstraction.h.
|
protected |
Accessor to inputs data.
Definition at line 46 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineexplicit |
Construct an Input management abstraction for the execution pipeline from an implementation of MultiSwitchRules.
ExecutionPipelineImplementation | Type of data deriving from MultiSwitchRules |
executionPipeline | Implementation of the execution pipeline |
Definition at line 55 of file execution_pipeline_inputs_management_abstraction.h.
|
overridedefault |
Default destructor.
|
inlineprotected |
Interface to the user-defined switch rule.
Input | Data type to send to the graphs (should be part of the exec pipeline types) |
data | Data of type Input |
graphId | Graph id |
Definition at line 79 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Can terminate implementation.
Terminate if there is no predecessor nodes connected and if there is no data in the input queues
lock | Flag to lock the test or not |
Definition at line 116 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Connect a graph to the switch.
graph | Graph to connect to the switch |
Definition at line 89 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprivate |
Connect a graph to the switch for the type Input.
Input | Type of input data |
graph | Graph to connect to the switch |
Definition at line 147 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Accessor to the switch core.
Definition at line 69 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Disconnect the switch from all of the graphs.
Definition at line 99 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Visitor for the execution pipeline edge.
printer | Printer gathering data information |
Definition at line 138 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Test if the receivers are empty.
Definition at line 85 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineprotected |
Wait statement when the node is alive and no input data are available.
Definition at line 126 of file execution_pipeline_inputs_management_abstraction.h.
|
inlineoverrideprotectedvirtual |
Wake up implementation (notify one node waiting on the condition variable)
Implements hh::core::abstraction::SlotAbstraction.
Definition at line 110 of file execution_pipeline_inputs_management_abstraction.h.
|
private |
Core switch used to call user-defined rules.
Definition at line 44 of file execution_pipeline_inputs_management_abstraction.h.