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

Source of the graph, only used in an outer graph. More...

#include "graph_source.h"

Inheritance diagram for hh::core::GraphSource< Inputs >:
Inheritance graph
Collaboration diagram for hh::core::GraphSource< Inputs >:
Collaboration graph

Public Member Functions

 GraphSource ()
 Default constructor.
 
 ~GraphSource () override=default
 Default destructor.
 
template<class Input >
void sendAndNotifyAllInputs (std::shared_ptr< Input > &data)
 Send a piece of data to all input nodes and notify them.
 
void print (Printer *printer)
 Gather source information.
 
std::vector< std::pair< std::string const, std::string const > > ids () const override
 Node ids [nodeId, nodeGroupId] accessor.
 
behavior::Nodenode () const override
 Getter to the node counterpart.
 
- Public Member Functions inherited from hh::core::abstraction::NodeAbstraction
 NodeAbstraction (std::string name)
 Core node constructor using the core's name.
 
virtual ~NodeAbstraction ()=default
 DEfault destructor.
 
std::string const & name () const
 Accessor to the core's name.
 
virtual std::string id () const
 Core's id ('x' + address of abstraction) as string.
 
bool isRegistered () const
 Accessor to registration flag.
 
GraphNodeAbstractionbelongingGraph () const
 Belonging graph accessor.
 
virtual int deviceId () const
 Get the device identifier (got from belonging graph)
 
virtual size_t graphId () const
 Get the graph identifier (got from belonging graph)
 
std::chrono::nanoseconds const & executionDuration () const
 Execution duration.
 
std::chrono::time_point< std::chrono::system_clock > const & startExecutionTimeStamp () const
 Accessor to the starting execution timestamp.
 
void startExecutionTimeStamp (std::chrono::time_point< std::chrono::system_clock > const &startExecutionTimeStamp)
 Setter to the starting execution timestamp.
 
void incrementExecutionDuration (std::chrono::nanoseconds const &exec)
 Increment execution duration.
 
virtual void registerNode (GraphNodeAbstraction *belongingGraph)
 Register node to the given graph.
 
virtual std::vector< std::pair< std::string const, std::string const > > ids () const =0
 Node ids [nodeId, nodeGroupId] accessor.
 
virtual behavior::Nodenode () const =0
 Node accessor.
 
- Public Member Functions inherited from hh::core::abstraction::NotifierAbstraction
 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.
 
- Public Member Functions inherited from hh::core::abstraction::SenderAbstraction< Inputs >
 SenderAbstraction (std::shared_ptr< implementor::ImplementorSender< Inputs > > concreteSender)
 Constructor using the concrete implementation.
 
virtual ~SenderAbstraction ()=default
 Default destructor.
 
std::set< SenderAbstraction< Inputs > * > const & senders () const
 Const accessor to senders.
 
std::set< SenderAbstraction< Inputs > * > & senders ()
 Accessor to senders.
 
std::set< ReceiverAbstraction< Inputs > * > const & connectedReceivers () const
 Accessor to the receivers attached to this SenderAbstraction.
 
void addReceiver (ReceiverAbstraction< Inputs > *const receiver)
 Add a ReceiverAbstraction.
 
void removeReceiver (ReceiverAbstraction< Inputs > *const receiver)
 Remove a ReceiverAbstraction.
 
void send (std::shared_ptr< Inputs > data)
 Send a data as output of the node.
 

Additional Inherited Members

- Protected Member Functions inherited from hh::core::abstraction::NotifierAbstraction
void duplicateEdgeNotifier (std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
 Duplicate edges of the current notifier to slots to clone in map.
 
- Protected Member Functions inherited from hh::core::abstraction::SenderAbstraction< Inputs >
void copyInnerStructure (SenderAbstraction< Inputs > *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.
 

Detailed Description

template<class ... Inputs>
class hh::core::GraphSource< Inputs >

Source of the graph, only used in an outer graph.

Template Parameters
InputsInput list types of the graph

Definition at line 42 of file graph_source.h.

Constructor & Destructor Documentation

◆ GraphSource()

template<class ... Inputs>
hh::core::GraphSource< Inputs >::GraphSource ( )
inline

Default constructor.

Definition at line 50 of file graph_source.h.

◆ ~GraphSource()

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

Default destructor.

Member Function Documentation

◆ ids()

template<class ... Inputs>
std::vector< std::pair< std::string const, std::string const > > hh::core::GraphSource< Inputs >::ids ( ) const
inlineoverridevirtual

Node ids [nodeId, nodeGroupId] accessor.

Returns
Node ids [nodeId, nodeGroupId]

Implements hh::core::abstraction::NodeAbstraction.

Definition at line 76 of file graph_source.h.

Here is the call graph for this function:

◆ node()

template<class ... Inputs>
behavior::Node * hh::core::GraphSource< Inputs >::node ( ) const
inlineoverridevirtual

Getter to the node counterpart.

Returns
Nothing, throw an error because there is no Node attached to the core
Exceptions
std::runtime_errorbecause there is no Node attached to the core

Implements hh::core::abstraction::NodeAbstraction.

Definition at line 83 of file graph_source.h.

◆ print()

template<class ... Inputs>
void hh::core::GraphSource< Inputs >::print ( Printer printer)
inline

Gather source information.

Parameters
printerPrinter visitor gathering information on nodes

Definition at line 70 of file graph_source.h.

Here is the call graph for this function:

◆ sendAndNotifyAllInputs()

template<class ... Inputs>
template<class Input >
void hh::core::GraphSource< Inputs >::sendAndNotifyAllInputs ( std::shared_ptr< Input > &  data)
inline

Send a piece of data to all input nodes and notify them.

Template Parameters
InputInput data type
Parameters
dataInput data

Definition at line 63 of file graph_source.h.

Here is the call graph for this function: