19#ifndef HEDGEHOG_GRAPH_SENDER_H
20#define HEDGEHOG_GRAPH_SENDER_H
27namespace implementor {
48 [[nodiscard]] std::set<abstraction::ReceiverAbstraction < Output> *>
const &
connectedReceivers()
const override {
49 throw std::runtime_error(
"A graph has no connected ReceiverAbstraction by itself.");
55 for (
auto sender : *this->
abstractSenders_) { sender->addReceiver(receiver); }
61 for (
auto sender : *this->
abstractSenders_) { sender->removeReceiver(receiver); }
67 void send([[maybe_unused]]std::shared_ptr<Output> data)
override {
68 throw std::runtime_error(
"A graph has no connected ReceiverAbstraction by itself");
Core's abstraction to receive a piece of data.
Core abstraction to send data.
Default concrete implementation of the sender abstraction for the graph core.
virtual ~GraphSender()=default
Default destructor.
GraphSender()=default
Default constructor.
void send(std::shared_ptr< Output > data) override
Do nothing, throw an error, a graph is not really connected to other nodes.
void initialize(abstraction::SenderAbstraction< Output > *senderAbstraction) override
Redefine the implementor to do nothing, the graph do nothing by itself.
void addReceiver(abstraction::ReceiverAbstraction< Output > *receiver) override
Add receiver node to graph's output node.
std::set< abstraction::ReceiverAbstraction< Output > * > const & connectedReceivers() const override
Do nothing, throw an error, a graph is not really connected to other nodes.
void removeReceiver(abstraction::ReceiverAbstraction< Output > *receiver) override
Remove receiver node to graph's output node.
Implementor for the SenderAbstraction.
std::unique_ptr< std::set< abstraction::SenderAbstraction< Output > * > > abstractSenders_
Linked SenderAbstraction.