21#ifndef HEDGEHOG_GRAPH_SOURCE_H
22#define HEDGEHOG_GRAPH_SOURCE_H
26#include "../abstractions/base/input_output/sender_abstraction.h"
28#include "../abstractions/base/input_output/notifier_abstraction.h"
29#include "../abstractions/base/node/node_abstraction.h"
30#include "../implementors/concrete_implementor/default_sender.h"
32#include "../implementors/concrete_implementor/default_notifier.h"
41template<
class ...Inputs>
53 abstraction::
SenderAbstraction<Inputs>(std::make_shared<implementor::DefaultSender < Inputs>>())... {}
76 [[nodiscard]] std::vector<std::pair<std::string const, std::string const>>
ids()
const override {
77 return {{this->
id(), this->
id()}};
84 throw std::runtime_error(
"Try to get a node out of a core switch while there is none.");
Printer abstraction to get a snapshot of the metrics of the Hedgehog graph.
virtual void printSource(core::abstraction::NodeAbstraction const *source)=0
Print outer graph source.
Behavior abstraction for the base node.
Core abstraction to notify slots.
void notify()
Notify a slot to wake up.
NotifierAbstraction(std::shared_ptr< implementor::ImplementorNotifier > notifier)
Constructor utilising a concrete implementation.
Core abstraction to send data.
SenderAbstraction(std::shared_ptr< implementor::ImplementorSender< Inputs > > concreteSender)
Constructor using the concrete implementation.
void send(std::shared_ptr< Inputs > data)
Send a data as output of the node.
Base core node abstraction.
virtual std::string id() const
Core's id ('x' + address of abstraction) as string.
NodeAbstraction(std::string name)
Core node constructor using the core's name.
Source of the graph, only used in an outer graph.
~GraphSource() override=default
Default destructor.
GraphSource()
Default constructor.
void print(Printer *printer)
Gather source information.
behavior::Node * node() const override
Getter to the node counterpart.
void sendAndNotifyAllInputs(std::shared_ptr< Input > &data)
Send a piece of data to all input nodes and notify them.
std::vector< std::pair< std::string const, std::string const > > ids() const override
Node ids [nodeId, nodeGroupId] accessor.