20 #ifndef HEDGEHOG_CORE_GRAPH_SOURCE_H 21 #define HEDGEHOG_CORE_GRAPH_SOURCE_H 23 #include "../../queue/sender/core_queue_sender.h" 24 #include "../../../../behavior/node.h" 31 template<
class ...GraphInputs>
40 HLOG_SELF(0,
"Creating CoreGraphSource")
59 HLOG_SELF(0,
"Add slot: " << slot->name() <<
"(" << slot->id() <<
")")
66 std::set<CoreSlot *>
getSlots()
override {
return {}; }
70 HLOG_SELF(2,
"Notify all terminated")
77 [[noreturn]] std::shared_ptr<CoreNode>
clone()
override {
78 std::ostringstream oss;
80 <<
"Internal error, should not be called, graph's source can't be clone, as an outer graph can't be cloned : " 82 HLOG_SELF(0, oss.str())
83 throw (std::runtime_error(oss.str()));
90 std::ostringstream oss;
91 oss <<
"Internal error, should not be called, source does not have a node: " << __FUNCTION__;
92 HLOG_SELF(0, oss.str())
93 throw (std::runtime_error(oss.str()));
101 [[maybe_unused]]
CoreNode *duplicateNode,
102 [[maybe_unused]] std::map<
CoreNode *, std::shared_ptr<CoreNode>> &correspondenceMap)
override {
103 std::ostringstream oss;
104 oss <<
"Internal error, should not be called, source does not have edges to connect in an execution pipeline: " 106 HLOG_SELF(0, oss.str())
107 throw (std::runtime_error(oss.str()));
112 #endif //HEDGEHOG_CORE_GRAPH_SOURCE_H CoreGraphSource()
CoreGraphSource default constructor.
behavior::Node * node() override
Get a node from the graph's source, that does not exist, throw an error in every case.
std::shared_ptr< CoreNode > clone() override
Get a clone of the graph's source, that does not exist, throw an error in every case.
Core Notifier interface, emit notification to CoreSlot.
Part of the outer graph that sends data from the outside to the input nodes.
void visit(AbstractPrinter *printer) override
Special visit method for a CoreQueueSender, printing an edge.
~CoreGraphSource() override
CoreGraphSource default destructor.
void duplicateEdge([[maybe_unused]] CoreNode *duplicateNode, [[maybe_unused]] std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override
Duplicate edge for a source, throw an error in every case.
Sender for nodes possessing a queue of data.
void notifyAllTerminated() override
Notify all slots that the node is terminated.
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.
std::set< CoreSlot * > getSlots() override
Get the graph's source slot.
void notifyAllTerminated() final
Notify all input nodes possessing a CoreQueueSender of termination.
NodeType
Hedgehog node's type.
Main Hedgehog core abstraction.
Notifier of CoreQueueSlot.
void visit(AbstractPrinter *printer) override
Special visit method for graph's source.
virtual void printNodeInformation(core::CoreNode *node)=0
Print node information.
void addSlot(CoreSlot *slot) final
Add slot to all inputs node possessing a CoreQueueSender.