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

Core abstraction to send data. More...

#include "sender_abstraction.h"

Inheritance diagram for hh::core::abstraction::SenderAbstraction< Output >:
Inheritance graph
Collaboration diagram for hh::core::abstraction::SenderAbstraction< Output >:
Collaboration graph

Public Member Functions

 SenderAbstraction (std::shared_ptr< implementor::ImplementorSender< Output > > concreteSender)
 Constructor using the concrete implementation.
 
virtual ~SenderAbstraction ()=default
 Default destructor.
 
std::set< SenderAbstraction< Output > * > const & senders () const
 Const accessor to senders.
 
std::set< SenderAbstraction< Output > * > & senders ()
 Accessor to senders.
 
std::set< ReceiverAbstraction< Output > * > const & connectedReceivers () const
 Accessor to the receivers attached to this SenderAbstraction.
 
void addReceiver (ReceiverAbstraction< Output > *const receiver)
 Add a ReceiverAbstraction.
 
void removeReceiver (ReceiverAbstraction< Output > *const receiver)
 Remove a ReceiverAbstraction.
 
void send (std::shared_ptr< Output > data)
 Send a data as output of the node.
 

Protected Member Functions

void copyInnerStructure (SenderAbstraction< Output > *copyableCore)
 Copy inner structure of the sender to this one.
 
void duplicateEdgeSender (std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
 Duplicate edges of the current sender to receiver to clone in map.
 

Private Attributes

std::shared_ptr< implementor::ImplementorSender< Output > > concreteSender_ = nullptr
 Concrete implementation of the sender used in the node.
 

Detailed Description

template<class Output>
class hh::core::abstraction::SenderAbstraction< Output >

Core abstraction to send data.

Template Parameters
OutputData type to send

Definition at line 48 of file sender_abstraction.h.

Constructor & Destructor Documentation

◆ SenderAbstraction()

template<class Output >
hh::core::abstraction::SenderAbstraction< Output >::SenderAbstraction ( std::shared_ptr< implementor::ImplementorSender< Output > >  concreteSender)
inlineexplicit

Constructor using the concrete implementation.

Parameters
concreteSenderSender concrete implementation

Definition at line 56 of file sender_abstraction.h.

◆ ~SenderAbstraction()

template<class Output >
virtual hh::core::abstraction::SenderAbstraction< Output >::~SenderAbstraction ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ addReceiver()

template<class Output >
void hh::core::abstraction::SenderAbstraction< Output >::addReceiver ( ReceiverAbstraction< Output > *const  receiver)
inline

Add a ReceiverAbstraction.

Parameters
receiverReceiverAbstraction to add

Definition at line 84 of file sender_abstraction.h.

Here is the caller graph for this function:

◆ connectedReceivers()

template<class Output >
std::set< ReceiverAbstraction< Output > * > const & hh::core::abstraction::SenderAbstraction< Output >::connectedReceivers ( ) const
inline

Accessor to the receivers attached to this SenderAbstraction.

Returns
The ReceiverAbstraction attached to this SenderAbstraction

Definition at line 78 of file sender_abstraction.h.

◆ copyInnerStructure()

template<class Output >
void hh::core::abstraction::SenderAbstraction< Output >::copyInnerStructure ( SenderAbstraction< Output > *  copyableCore)
inlineprotected

Copy inner structure of the sender to this one.

Parameters
copyableCoreSenderAbstraction to copy into this

Definition at line 97 of file sender_abstraction.h.

Here is the caller graph for this function:

◆ duplicateEdgeSender()

template<class Output >
void hh::core::abstraction::SenderAbstraction< Output >::duplicateEdgeSender ( std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &  mapping)
inlineprotected

Duplicate edges of the current sender to receiver to clone in map.

Parameters
mappingMap of the nodes -> clone
Exceptions
throwstd::runtime_error if the current node is not mapped to its clone, if the clone is not a ReceiverAbstraction, if a slot is not a node

Definition at line 105 of file sender_abstraction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeReceiver()

template<class Output >
void hh::core::abstraction::SenderAbstraction< Output >::removeReceiver ( ReceiverAbstraction< Output > *const  receiver)
inline

Remove a ReceiverAbstraction.

Parameters
receiverReceiverAbstraction to remove

Definition at line 88 of file sender_abstraction.h.

◆ send()

template<class Output >
void hh::core::abstraction::SenderAbstraction< Output >::send ( std::shared_ptr< Output >  data)
inline

Send a data as output of the node.

Parameters
dataData to send to successor node or output of the graph

Definition at line 92 of file sender_abstraction.h.

◆ senders() [1/2]

template<class Output >
std::set< SenderAbstraction< Output > * > & hh::core::abstraction::SenderAbstraction< Output >::senders ( )
inline

Accessor to senders.

Present the senders linked to this abstraction, usually one, may be multiple for the graph presenting all of the output node senders

Returns
Reference to senders

Definition at line 74 of file sender_abstraction.h.

◆ senders() [2/2]

template<class Output >
std::set< SenderAbstraction< Output > * > const & hh::core::abstraction::SenderAbstraction< Output >::senders ( ) const
inline

Const accessor to senders.

Present the senders linked to this abstraction, usually one, may be multiple for the graph presenting all of the output node senders

Returns
Const reference to senders

Definition at line 68 of file sender_abstraction.h.

Here is the caller graph for this function:

Member Data Documentation

◆ concreteSender_

template<class Output >
std::shared_ptr<implementor::ImplementorSender<Output> > hh::core::abstraction::SenderAbstraction< Output >::concreteSender_ = nullptr
private

Concrete implementation of the sender used in the node.

Definition at line 51 of file sender_abstraction.h.