Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
hh::core::abstraction::NotifierAbstraction Class Reference

Core abstraction to notify slots. More...

#include "notifier_abstraction.h"

Inheritance diagram for hh::core::abstraction::NotifierAbstraction:
Inheritance graph
Collaboration diagram for hh::core::abstraction::NotifierAbstraction:
Collaboration graph

Public Member Functions

 NotifierAbstraction (std::shared_ptr< implementor::ImplementorNotifier > notifier)
 Constructor utilising a concrete implementation.
 
virtual ~NotifierAbstraction ()=default
 Default destructor.
 
std::set< NotifierAbstraction * > const & notifiers () const
 Const accessor to notifiers.
 
std::set< NotifierAbstraction * > & notifiers ()
 Accessor to notifiers.
 
void addSlot (SlotAbstraction *const slot)
 Add a SlotAbstraction to this notifier.
 
void removeSlot (SlotAbstraction *const slot)
 Remove SlotAbstraction from this notifier.
 
std::set< SlotAbstraction * > const & connectedSlots () const
 Accessor to the slots attached to this notifier.
 
void notify ()
 Notify a slot to wake up.
 
void notifyAllTerminated ()
 Notifier all slots that this node is terminated.
 

Protected Member Functions

void duplicateEdgeNotifier (std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
 Duplicate edges of the current notifier to slots to clone in map.
 

Private Attributes

std::shared_ptr< implementor::ImplementorNotifierconcreteNotifier_ = nullptr
 Concrete implementation of the notifier used in the node.
 

Detailed Description

Core abstraction to notify slots.

Definition at line 47 of file notifier_abstraction.h.

Constructor & Destructor Documentation

◆ NotifierAbstraction()

hh::core::abstraction::NotifierAbstraction::NotifierAbstraction ( std::shared_ptr< implementor::ImplementorNotifier notifier)
inlineexplicit

Constructor utilising a concrete implementation.

Parameters
notifierConcrete notifier implementation

Definition at line 54 of file notifier_abstraction.h.

Here is the caller graph for this function:

◆ ~NotifierAbstraction()

virtual hh::core::abstraction::NotifierAbstraction::~NotifierAbstraction ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ addSlot()

void hh::core::abstraction::NotifierAbstraction::addSlot ( SlotAbstraction *const  slot)
inline

Add a SlotAbstraction to this notifier.

Parameters
slotSlotAbstraction to add

Definition at line 76 of file notifier_abstraction.h.

Here is the caller graph for this function:

◆ connectedSlots()

std::set< SlotAbstraction * > const & hh::core::abstraction::NotifierAbstraction::connectedSlots ( ) const
inline

Accessor to the slots attached to this notifier.

Returns
The SlotAbstraction attached to this notifier

Definition at line 84 of file notifier_abstraction.h.

Here is the caller graph for this function:

◆ duplicateEdgeNotifier()

void hh::core::abstraction::NotifierAbstraction::duplicateEdgeNotifier ( std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &  mapping)
inlineprotected

Duplicate edges of the current notifier to slots 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 SlotAbstraction, if a slot is not a node

Definition at line 99 of file notifier_abstraction.h.

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

◆ notifiers() [1/2]

std::set< NotifierAbstraction * > & hh::core::abstraction::NotifierAbstraction::notifiers ( )
inline

Accessor to notifiers.

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

Returns
Reference to notifiers

Definition at line 72 of file notifier_abstraction.h.

◆ notifiers() [2/2]

std::set< NotifierAbstraction * > const & hh::core::abstraction::NotifierAbstraction::notifiers ( ) const
inline

Const accessor to notifiers.

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

Returns
Const reference to notifiers

Definition at line 66 of file notifier_abstraction.h.

Here is the caller graph for this function:

◆ notify()

void hh::core::abstraction::NotifierAbstraction::notify ( )
inline

Notify a slot to wake up.

Definition at line 89 of file notifier_abstraction.h.

Here is the caller graph for this function:

◆ notifyAllTerminated()

void hh::core::abstraction::NotifierAbstraction::notifyAllTerminated ( )
inline

Notifier all slots that this node is terminated.

Definition at line 92 of file notifier_abstraction.h.

◆ removeSlot()

void hh::core::abstraction::NotifierAbstraction::removeSlot ( SlotAbstraction *const  slot)
inline

Remove SlotAbstraction from this notifier.

Parameters
slotSlotAbstraction to remove

Definition at line 80 of file notifier_abstraction.h.

Member Data Documentation

◆ concreteNotifier_

std::shared_ptr<implementor::ImplementorNotifier> hh::core::abstraction::NotifierAbstraction::concreteNotifier_ = nullptr
private

Concrete implementation of the notifier used in the node.

Definition at line 50 of file notifier_abstraction.h.