20 #ifndef HEDGEHOG_CORE_RECEIVER_H 21 #define HEDGEHOG_CORE_RECEIVER_H 25 #include <shared_mutex> 28 #include "../../../node/core_node.h" 29 #include "core_slot.h" 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 39 #endif //DOXYGEN_SHOULD_SKIP_THIS 51 :
CoreNode(name, type, numberThreads) {
52 HLOG_SELF(0,
"Creating CoreReceiver with type: " << (
int) type <<
" and name: " << name)
68 virtual void receive(std::shared_ptr<Input> data) = 0;
80 virtual std::set<CoreReceiver<Input> *>
receivers() = 0;
84 #endif //HEDGEHOG_CORE_RECEIVER_H NodeType type() const
Node type accessor.
virtual bool receiverEmpty()=0
Accessor to test emptiness on the receiver.
Receiver Interface, receive one data type from CoreSender.
~CoreReceiver() override
Default destructor.
virtual std::set< CoreReceiver< Input > * > receivers()=0
Accessor to all receivers connected to this receiver.
CoreReceiver(std::string_view const &name, NodeType const type, size_t const numberThreads)
Constructor with node name, node type and number of threads for the node.
virtual size_t queueSize()
Interface to get the number of element to be treated by this node for this type, by default return 0...
NodeType
Hedgehog node's type.
Sender interface, send data to CoreReceiver.
Main Hedgehog core abstraction.
std::string_view const & name() const
Node name accessor.
virtual void removeSender(CoreSender< Input > *sender)=0
Interface to remove a CoreSender from the receiver.
size_t numberThreads() const
Number of threads associated accessor.
virtual void receive(std::shared_ptr< Input > data)=0
Interface to receive a data.
virtual void addSender(CoreSender< Input > *sender)=0
Interface to add a CoreSender to the receiver.