20 #ifndef HEDGEHOG_CORE_SWITCH_H 21 #define HEDGEHOG_CORE_SWITCH_H 24 #include "../../io/queue/sender/core_queue_sender.h" 31 template<
class ...GraphInputs>
43 std::shared_ptr<CoreNode>
clone()
override {
return std::make_shared<
CoreSwitch<GraphInputs...>>(); }
50 std::ostringstream oss;
51 oss <<
"Internal error, a switch has no nodes: " << __FUNCTION__;
52 HLOG_SELF(0, oss.str())
53 throw (std::runtime_error(oss.str()));
73 std::ostringstream oss;
74 oss <<
"Switch Info: " << std::endl;
75 (printSenderInfo<GraphInputs>(oss), ...);
84 std::map<
CoreNode *, std::shared_ptr<CoreNode>> &correspondenceMap)
override {
92 template<
class GraphInput>
94 oss <<
typeid(GraphInput).
name() << std::endl;
96 oss <<
"\t" << slot->id() <<
" / " << slot->name() << std::endl;
104 std::ostringstream oss;
105 oss <<
"Runtime error, A switch does not have any slots: " << __FUNCTION__;
106 HLOG_SELF(0, oss.str())
107 throw (std::runtime_error(oss.str()));
112 #endif //HEDGEHOG_CORE_SWITCH_H void printSenderInfo(std::ostringstream &oss)
Stream all sender information into oss.
Core Notifier interface, emit notification to CoreSlot.
void removeSlot(CoreSlot *slot) override
Remove a slot from every input types.
void visit([[maybe_unused]]AbstractPrinter *) override
Visit a switch, do nothing.
Sender for nodes possessing a queue of data.
void duplicateEdge(CoreNode *duplicateNode, std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override
Duplicate all the edges from this to it's copy duplicateNode.
CoreSwitch()
Default core switch.
void notifyAllTerminated() override
Notify all slots that the node is terminated.
std::shared_ptr< CoreNode > clone() override
Clone a default core switch.
std::shared_ptr< std::set< CoreSlot * > > const & slots() const
Connected slots accessor.
Core switch, determine where to divert data to the graphs.
Node Behavior definition.
Slot interface, receive notification from CoreNotifier.
void addSlot(CoreSlot *slot) override
Add a slot to the set of connected slots.
void notifyAllTerminated() override
Notify terminated for all input types.
std::set< CoreSlot * > getSlots() override
Slots accessors, throw an error, a switch does not have any slots.
NodeType
Hedgehog node's type.
void removeSlot(CoreSlot *slot) override
Remove a slot from the set of connected slots.
behavior::Node * node() override
Send a user node, not possible for a switch, should only be managed by an execution pipeline...
Main Hedgehog core abstraction.
Notifier of CoreQueueSlot.
void duplicateEdge(CoreNode *duplicateNode, std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override
Duplicate all the edges from this to its copy duplicateNode.
std::string_view const & name() const
Node name accessor.
void addSlot(CoreSlot *slot) override
Add a slot for every input types.
std::string extraPrintingInformation() override
Print extra information for the switch.