Implementation of an output port in the computation graph. More...
#include <output_port.h>
Public Member Functions | |
| OutputPort (const std::string &id, ComputationalNode *parent) | |
| Constructor. More... | |
| void | publish (const T *msg) |
| Publish a msg to all subscribers. More... | |
| size_t | subscriptionsSize () override |
| Return the number the number of ports subscribed to this port. More... | |
Public Member Functions inherited from Port | |
| Port ()=delete | |
| virtual | ~Port ()=default |
| Port (std::string id, ComputationalNode *parent) | |
| Constructor. More... | |
| const std::string & | id () |
| Returns the port 'id'. More... | |
| ComputationalNode * | parent () const |
| Returns the port parent node. More... | |
Protected Member Functions | |
| void | add_subscriber (std::function< void(const T *)> callback) |
| Adds a subscriber to this port. More... | |
Friends | |
| template<typename , typename > | |
| class | InputPort |
Implementation of an output port in the computation graph.
It forwards msgs to subscribed ports via its 'publish' method
|
inline |
Constructor.
|
inlineprotected |
Adds a subscriber to this port.
InputPorts subscribe themselves to OutputPorts
|
inline |
Publish a msg to all subscribers.
|
inlineoverridevirtual |
Return the number the number of ports subscribed to this port.
Implements Port.