20 #ifndef HEDGEHOG_CORE_GRAPH_SINK_H 21 #define HEDGEHOG_CORE_GRAPH_SINK_H 23 #include "../../queue/receiver/core_queue_multi_receivers.h" 30 template<
class GraphOutput>
38 HLOG_SELF(0,
"Creating CoreGraphSink")
57 std::ostringstream oss;
58 oss <<
"Internal error, should not be called, sink does not have a node: " << __FUNCTION__;
59 HLOG_SELF(0, oss.str())
60 throw (std::runtime_error(oss.str()));
66 [[noreturn]] std::shared_ptr<CoreNode>
clone()
override {
67 std::ostringstream oss;
69 <<
"Internal error, should not be called, graph's sink can't be clone, as an outer graph can't be cloned : " 71 HLOG_SELF(0, oss.str())
72 throw (std::runtime_error(oss.str()));
78 std::unique_lock<std::mutex> lock(*(this->
slotMutex()));
80 HLOG_SELF(2,
"Wait for the notification")
86 HLOG_SELF(2,
"Notification received")
97 std::shared_ptr<CoreNode>> &correspondenceMap)
override {
98 std::ostringstream oss;
99 oss <<
"Internal error, should not be called, sink does not have edges to connect in an execution pipeline: " 101 HLOG_SELF(0, oss.str())
102 throw (std::runtime_error(oss.str()));
107 #endif //HEDGEHOG_CORE_GRAPH_SINK_H Receiver Interface, receive one data type from CoreSender.
CoreGraphSink()
Default sink constructor.
bool waitForNotification() override
Wait for notification from the output nodes and return the state of the sink.
~CoreGraphSink() override
Default sink destructor.
std::shared_ptr< std::mutex > const & slotMutex() const
Mutex accessor.
void duplicateEdge([[maybe_unused]]CoreNode *duplicateNode, [[maybe_unused]]std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override
Duplicate edge for a sink, throw an error in every case.
Node Behavior definition.
Slot interface, receive notification from CoreNotifier.
bool hasNotBeenVisited(core::CoreNode const *node)
Accessor to check if a node has been visited by the printer.
Part of the outer graph that gathers data from the output nodes and makes them available as the graph...
NodeType
Hedgehog node's type.
size_t numberInputNodes() const final
Number of CoreNotifier linked accessor.
void visit(AbstractPrinter *printer) override
Special visit method for graph's sink.
Main Hedgehog core abstraction.
Multi receivers for nodes possessing a queue of data.
std::shared_ptr< std::condition_variable > const & notifyConditionVariable() const
Condition variable accessor.
behavior::Node * node() override
Get a node from the graph's sink, that does not exist, throw an error in every case.
bool receiversEmpty() final
Test emptiness of all receivers.
virtual void printNodeInformation(core::CoreNode *node)=0
Print node information.
std::shared_ptr< CoreNode > clone() override
Get a clone of the graph's sink, that does not exist, throw an error in every case.