Go to the documentation of this file.
41 template <
class T_IN,
class T_OUT>
59 if(_maxSubs && _nSubs >= _maxSubs) {
61 s <<
"Port \"" << this->
id() <<
"\" of node \"" << this->
parent()->
id() <<
"\" can only have " << _maxSubs <<
" subscriber(s)";
65 using std::placeholders::_1;
67 port->add_subscriber(receive_f);
82 {
return _maxSubs == 0 ? SIZE_MAX : _maxSubs; }
91 void receive(
const T_IN* msg)
93 if ( msg ==
nullptr ) {
98 if constexpr ( std::is_same_v<T_IN, T_OUT> )
109 std::function<void(
const T_OUT*)> _callback;
111 std::size_t _maxSubs;
113 std::size_t _nSubs = 0;
117 #endif //INPUT_PORT_H
Base class implementing a port in the computational graph.
Definition: port.h:30
ComputationalNode * parent() const
Returns the port parent node.
Definition: port.h:53
const std::string & id()
Returns the port 'id'.
Definition: port.h:47
const std::string & id() const
Returns the node 'id'.
Definition: computational_node.h:57
static void convert(const T_IN *, T_OUT &)
Definition: data_conversion.h:37
static EXCEPTION logCreate(LOG_EXCEPTION_T &exception, const std::string &msg, NRPLogger::spdlog_out_fcn_t spdlogCall=NRPLogger::critical)
Definition: nrp_exceptions.h:73
Implementation of an output port in the computation graph.
Definition: output_port.h:36
port
Definition: python_json_engine.py:197
Base class implementing a node in the computational graph.
Definition: computational_node.h:31