19#ifndef HEDGEHOG_GRAPH_RECEIVER_H
20#define HEDGEHOG_GRAPH_RECEIVER_H
24#include "../../implementor/implementor_receiver.h"
25#include "../../../abstractions/base/input_output/receiver_abstraction.h"
32namespace implementor {
55 throw std::runtime_error(
"It is not possible to get the number of input data from the graph receiver as it is only "
56 "used to transfer data to input nodes.");
64 throw std::runtime_error(
"It is not possible to get the number of input data from the graph receiver as it is only "
65 "used to transfer data to input nodes.");
72 [[nodiscard]]
bool empty()
const override {
73 throw std::runtime_error(
"It is not possible to test if there is input data from the graph receiver as it is only "
74 "used to transfer data to input nodes.");
82 throw std::runtime_error(
"It is not possible to get input data from the graph receiver as it is only used to "
83 "transfer data to input nodes.");
89 std::set<abstraction::SenderAbstraction<Input> *>
const &
connectedSenders()
const override {
90 throw std::runtime_error(
"A graph is not connected to any senders");
95 void receive(std::shared_ptr<Input> data)
override {
Core's abstraction to receive a piece of data.
Core abstraction to send data.
Default concrete implementation of the receiver abstraction for the graph core.
size_t numberElementsReceived() const override
Do nothing, throw an error, a graph does not receive data, its input nodes do.
void initialize(abstraction::ReceiverAbstraction< Input > *receiverAbstraction) override
Redefine the implementor to do nothing, the graph do nothing by itself.
void addSender(abstraction::SenderAbstraction< Input > *const sender) override
Add a sender to add to the graph input nodes.
std::shared_ptr< Input > getInputData() override
Do nothing, throw an error, a graph does not receive data, its input nodes do.
bool empty() const override
Do nothing, throw an error, a graph does not receive data, its input nodes do.
void removeSender(abstraction::SenderAbstraction< Input > *const sender) override
Remove a sender to add to the graph input nodes.
virtual ~GraphReceiver()=default
Default destructor.
std::set< abstraction::SenderAbstraction< Input > * > const & connectedSenders() const override
Do nothing, throw an error, a graph is not really connected to other nodes.
void receive(std::shared_ptr< Input > data) override
Receive a data and transmit to its input nodes.
GraphReceiver()=default
Default constructor.
size_t maxNumberElementsReceived() const override
Do nothing, throw an error, a graph does not receive data, its input nodes do.
Implementor for the ReceiverAbstraction.
std::unique_ptr< std::set< abstraction::ReceiverAbstraction< Input > * > > abstractReceivers_
Set of linked ReceiverAbstraction.