Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
hh::core::abstraction::TaskInputsManagementAbstraction< Inputs > Class Template Reference

Input management abstraction for the task. More...

#include "task_inputs_management_abstraction.h"

Inheritance diagram for hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >:
Inheritance graph
Collaboration diagram for hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >:
Collaboration graph

Public Types

using inputs_t = std::tuple< Inputs... >
 Accessor to the input types.
 

Public Member Functions

template<class NodeType >
 TaskInputsManagementAbstraction (NodeType *const nodeTask, TaskNodeAbstraction *const coreTask)
 Constructor using a node task and its core.
 
template<hh::tool::ConcreteMultiReceiverImplementation< Inputs... > ConcreteMultiReceivers, hh::tool::ConcreteMultiExecuteImplementation< Inputs... > ConcreteMultiExecutes>
 TaskInputsManagementAbstraction (TaskNodeAbstraction *const coreTask, std::shared_ptr< implementor::ImplementorSlot > concreteSlot, std::shared_ptr< ConcreteMultiReceivers > concreteMultiReceivers, std::shared_ptr< ConcreteMultiExecutes > concreteMultiExecutes)
 Constructor using a node and the concrete implementor.
 
 ~TaskInputsManagementAbstraction () override=default
 Default destructor.
 
bool receiversEmpty () const
 Test if the receivers are empty for the task.
 
- Public Member Functions inherited from hh::core::abstraction::SlotAbstraction
 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.
 
- Public Member Functions inherited from hh::core::abstraction::ReceiverAbstraction< Inputs >
 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.
 
- Public Member Functions inherited from hh::core::abstraction::ExecuteAbstraction< Inputs >
 ExecuteAbstraction (std::shared_ptr< implementor::ImplementorExecute< Inputs > > concreteExecute)
 Constructor using a user-defined execution.
 
virtual ~ExecuteAbstraction ()=default
 Default destructor.
 
void callExecute (std::shared_ptr< Inputs > data)
 Interface for calling user-defined execution.
 

Protected Member Functions

size_t totalNumberElementsReceived () const
 Accessor to the total number of elements received for all input types.
 
void operateReceivers ()
 Access all the task receivers to process an element.
 
void callAllExecuteWithNullptr ()
 Call for all types the user-defined execute method with nullptr as data.
 
void wakeUp () final
 Wake up implementation (notify one node waiting on the condition variable)
 
void copyInnerStructure (TaskInputsManagementAbstraction< Inputs... > *copyableCore)
 Copy the task core inner structure to this.
 
void printEdgesInformation (Printer *printer)
 Add edge information to the printer.
 
- Protected Member Functions inherited from hh::core::abstraction::SlotAbstraction
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.
 
- Protected Member Functions inherited from hh::core::abstraction::ReceiverAbstraction< Inputs >
void copyInnerStructure (ReceiverAbstraction< Inputs > *copyableCore)
 Copy inner structure of the receiver to this one.
 

Private Member Functions

template<tool::ContainsConcept< Inputs... > InputDataType>
void operateReceiver ()
 Access the ReceiverAbstraction of the type InputDataType to process an element.
 

Private Attributes

TaskNodeAbstraction *const coreTask_ = nullptr
 Accessor to the core task.
 

Detailed Description

template<class ... Inputs>
class hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >

Input management abstraction for the task.

Template Parameters
InputsTypes of input data

Definition at line 46 of file task_inputs_management_abstraction.h.

Member Typedef Documentation

◆ inputs_t

template<class ... Inputs>
using hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::inputs_t = std::tuple<Inputs...>

Accessor to the input types.

Definition at line 53 of file task_inputs_management_abstraction.h.

Constructor & Destructor Documentation

◆ TaskInputsManagementAbstraction() [1/2]

template<class ... Inputs>
template<class NodeType >
hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::TaskInputsManagementAbstraction ( NodeType *const  nodeTask,
TaskNodeAbstraction *const  coreTask 
)
inlineexplicit

Constructor using a node task and its core.

Template Parameters
NodeTypeType of the node
Parameters
nodeTaskNode instance
coreTaskCore node instance

Definition at line 60 of file task_inputs_management_abstraction.h.

◆ TaskInputsManagementAbstraction() [2/2]

template<class ... Inputs>
template<hh::tool::ConcreteMultiReceiverImplementation< Inputs... > ConcreteMultiReceivers, hh::tool::ConcreteMultiExecuteImplementation< Inputs... > ConcreteMultiExecutes>
hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::TaskInputsManagementAbstraction ( TaskNodeAbstraction *const  coreTask,
std::shared_ptr< implementor::ImplementorSlot concreteSlot,
std::shared_ptr< ConcreteMultiReceivers >  concreteMultiReceivers,
std::shared_ptr< ConcreteMultiExecutes >  concreteMultiExecutes 
)
inlineexplicit

Constructor using a node and the concrete implementor.

Template Parameters
ConcreteMultiReceiversConcrete implementation of multi receivers abstraction
ConcreteMultiExecutesConcrete implementation of execute abstraction
Parameters
coreTaskCore task instance
concreteSlotConcrete slot implementation
concreteMultiReceiversConcrete multi receivers implementation
concreteMultiExecutesConcrete multi executes implementation

Definition at line 80 of file task_inputs_management_abstraction.h.

◆ ~TaskInputsManagementAbstraction()

template<class ... Inputs>
hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::~TaskInputsManagementAbstraction ( )
overridedefault

Default destructor.

Member Function Documentation

◆ callAllExecuteWithNullptr()

template<class ... Inputs>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::callAllExecuteWithNullptr ( )
inlineprotected

Call for all types the user-defined execute method with nullptr as data.

Definition at line 111 of file task_inputs_management_abstraction.h.

Here is the call graph for this function:

◆ copyInnerStructure()

template<class ... Inputs>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::copyInnerStructure ( TaskInputsManagementAbstraction< Inputs... > *  copyableCore)
inlineprotected

Copy the task core inner structure to this.

Parameters
copyableCoreTask core to copy from

Definition at line 118 of file task_inputs_management_abstraction.h.

Here is the call graph for this function:

◆ operateReceiver()

template<class ... Inputs>
template<tool::ContainsConcept< Inputs... > InputDataType>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::operateReceiver ( )
inlineprivate

Access the ReceiverAbstraction of the type InputDataType to process an element.

Template Parameters
InputDataType

Definition at line 133 of file task_inputs_management_abstraction.h.

Here is the call graph for this function:

◆ operateReceivers()

template<class ... Inputs>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::operateReceivers ( )
inlineprotected

Access all the task receivers to process an element.

Definition at line 108 of file task_inputs_management_abstraction.h.

◆ printEdgesInformation()

template<class ... Inputs>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::printEdgesInformation ( Printer printer)
inlineprotected

Add edge information to the printer.

Parameters
printerPrinter visitor gathering edge information

Definition at line 125 of file task_inputs_management_abstraction.h.

Here is the call graph for this function:

◆ receiversEmpty()

template<class ... Inputs>
bool hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::receiversEmpty ( ) const
inline

Test if the receivers are empty for the task.

Returns
True if the receivers are empty, else false

Definition at line 97 of file task_inputs_management_abstraction.h.

◆ totalNumberElementsReceived()

template<class ... Inputs>
size_t hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::totalNumberElementsReceived ( ) const
inlineprotected

Accessor to the total number of elements received for all input types.

Returns
The total number of elements received for all input types

Definition at line 103 of file task_inputs_management_abstraction.h.

◆ wakeUp()

template<class ... Inputs>
void hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::wakeUp ( )
inlinefinalprotectedvirtual

Wake up implementation (notify one node waiting on the condition variable)

Implements hh::core::abstraction::SlotAbstraction.

Definition at line 114 of file task_inputs_management_abstraction.h.

Here is the call graph for this function:

Member Data Documentation

◆ coreTask_

template<class ... Inputs>
TaskNodeAbstraction* const hh::core::abstraction::TaskInputsManagementAbstraction< Inputs >::coreTask_ = nullptr
private

Accessor to the core task.

Definition at line 51 of file task_inputs_management_abstraction.h.