Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
hh::core::implementor::GraphReceiver< Input > Class Template Reference

Default concrete implementation of the receiver abstraction for the graph core. More...

#include "graph_receiver.h"

Inheritance diagram for hh::core::implementor::GraphReceiver< Input >:
Inheritance graph
Collaboration diagram for hh::core::implementor::GraphReceiver< Input >:
Collaboration graph

Public Member Functions

 GraphReceiver ()=default
 Default constructor.
 
virtual ~GraphReceiver ()=default
 Default destructor.
 
void initialize (abstraction::ReceiverAbstraction< Input > *receiverAbstraction) override
 Redefine the implementor to do nothing, the graph do nothing by itself.
 
size_t numberElementsReceived () const override
 Do nothing, throw an error, a graph does not receive data, its input nodes do.
 
size_t maxNumberElementsReceived () const override
 Do nothing, throw an error, a graph does not receive data, its input nodes do.
 
bool empty () const override
 Do nothing, throw an error, a graph does not receive data, its input nodes do.
 
std::shared_ptr< Input > getInputData () override
 Do nothing, throw an error, a graph does not receive data, its input nodes do.
 
std::set< abstraction::SenderAbstraction< Input > * > const & connectedSenders () const override
 Do nothing, throw an error, a graph is not really connected to other nodes.
 
void receive (std::shared_ptr< Input > data) override
 Receive a data and transmit to its input nodes.
 
void addSender (abstraction::SenderAbstraction< Input > *const sender) override
 Add a sender to add to the graph input nodes.
 
void removeSender (abstraction::SenderAbstraction< Input > *const sender) override
 Remove a sender to add to the graph input nodes.
 
- Public Member Functions inherited from hh::core::implementor::ImplementorReceiver< Input >
 ImplementorReceiver ()
 Default constructor.
 
virtual ~ImplementorReceiver ()=default
 Default destructor.
 
std::set< abstraction::ReceiverAbstraction< Input > * > & receivers ()
 Accessor to the linked ReceiverAbstraction.
 
virtual void initialize (abstraction::ReceiverAbstraction< Input > *receiverAbstraction)
 Initialize the implementor Receiver by setting the corresponding abstraction.
 
virtual std::set< abstraction::SenderAbstraction< Input > * > const & connectedSenders () const =0
 Accessor to the connected senders.
 
virtual void addSender (abstraction::SenderAbstraction< Input > *sender)=0
 Add a SenderAbstraction.
 
virtual void removeSender (abstraction::SenderAbstraction< Input > *sender)=0
 Remove a SenderAbstraction.
 
virtual void receive (std::shared_ptr< Input > data)=0
 Receive data interface.
 
virtual std::shared_ptr< Input > getInputData ()=0
 Accessor to a received data.
 
virtual size_t numberElementsReceived () const =0
 Accessor to number of data waiting to be processed in the queue.
 
virtual size_t maxNumberElementsReceived () const =0
 Accessor to the maximum number of data waiting to be processed in the queue during the whole execution.
 
virtual bool empty () const =0
 Test if the receiver is empty or not.
 

Additional Inherited Members

- Protected Attributes inherited from hh::core::implementor::ImplementorReceiver< Input >
std::unique_ptr< std::set< abstraction::ReceiverAbstraction< Input > * > > abstractReceivers_ = nullptr
 Set of linked ReceiverAbstraction.
 

Detailed Description

template<class Input>
class hh::core::implementor::GraphReceiver< Input >

Default concrete implementation of the receiver abstraction for the graph core.

Template Parameters
InputInput type

Definition at line 37 of file graph_receiver.h.

Constructor & Destructor Documentation

◆ GraphReceiver()

template<class Input >
hh::core::implementor::GraphReceiver< Input >::GraphReceiver ( )
explicitdefault

Default constructor.

◆ ~GraphReceiver()

template<class Input >
virtual hh::core::implementor::GraphReceiver< Input >::~GraphReceiver ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ addSender()

template<class Input >
void hh::core::implementor::GraphReceiver< Input >::addSender ( abstraction::SenderAbstraction< Input > *const  sender)
inlineoverridevirtual

Add a sender to add to the graph input nodes.

Parameters
senderSender to add

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 104 of file graph_receiver.h.

◆ connectedSenders()

template<class Input >
std::set< abstraction::SenderAbstraction< Input > * > const & hh::core::implementor::GraphReceiver< Input >::connectedSenders ( ) const
inlineoverridevirtual

Do nothing, throw an error, a graph is not really connected to other nodes.

Returns
Nothing, throw a std::runtime_error
Exceptions
std::runtime_errorA graph is not connected to any senders

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 89 of file graph_receiver.h.

◆ empty()

template<class Input >
bool hh::core::implementor::GraphReceiver< Input >::empty ( ) const
inlineoverridevirtual

Do nothing, throw an error, a graph does not receive data, its input nodes do.

Returns
Nothing, throw a std::runtime_error
Exceptions
std::runtime_errorIt is not possible to get the number of input data from the graph receiver as it is only used to transfer data to input nodes.

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 72 of file graph_receiver.h.

◆ getInputData()

template<class Input >
std::shared_ptr< Input > hh::core::implementor::GraphReceiver< Input >::getInputData ( )
inlineoverridevirtual

Do nothing, throw an error, a graph does not receive data, its input nodes do.

Returns
Nothing, throw a std::runtime_error
Exceptions
std::runtime_errorIt is not possible to get the number of input data from the graph receiver as it is only used to transfer data to input nodes.

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 81 of file graph_receiver.h.

◆ initialize()

template<class Input >
void hh::core::implementor::GraphReceiver< Input >::initialize ( abstraction::ReceiverAbstraction< Input > *  receiverAbstraction)
inlineoverridevirtual

Redefine the implementor to do nothing, the graph do nothing by itself.

Parameters
receiverAbstractionAbstraction not used

Reimplemented from hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 48 of file graph_receiver.h.

◆ maxNumberElementsReceived()

template<class Input >
size_t hh::core::implementor::GraphReceiver< Input >::maxNumberElementsReceived ( ) const
inlineoverridevirtual

Do nothing, throw an error, a graph does not receive data, its input nodes do.

Returns
Nothing, throw a std::runtime_error
Exceptions
std::runtime_errorIt is not possible to get the number of input data from the graph receiver as it is only used to transfer data to input nodes.

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 63 of file graph_receiver.h.

◆ numberElementsReceived()

template<class Input >
size_t hh::core::implementor::GraphReceiver< Input >::numberElementsReceived ( ) const
inlineoverridevirtual

Do nothing, throw an error, a graph does not receive data, its input nodes do.

Returns
Nothing, throw a std::runtime_error
Exceptions
std::runtime_errorIt is not possible to get the number of input data from the graph receiver as it is only used to transfer data to input nodes.

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 54 of file graph_receiver.h.

◆ receive()

template<class Input >
void hh::core::implementor::GraphReceiver< Input >::receive ( std::shared_ptr< Input >  data)
inlineoverridevirtual

Receive a data and transmit to its input nodes.

Parameters
dataDat ato transmit to input nodes

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 95 of file graph_receiver.h.

◆ removeSender()

template<class Input >
void hh::core::implementor::GraphReceiver< Input >::removeSender ( abstraction::SenderAbstraction< Input > *const  sender)
inlineoverridevirtual

Remove a sender to add to the graph input nodes.

Parameters
senderSender to remove

Implements hh::core::implementor::ImplementorReceiver< Input >.

Definition at line 113 of file graph_receiver.h.