Go to the documentation of this file.
49 { _data.reserve(queue_size); }
84 if(_data.size() < _data.capacity()) {
89 std::string s =
"Port handle '" +
singlePort->id() +
"' reached max size. Added msg will be dropped.";
105 {
return _data.size(); }
110 std::shared_ptr<OutputPort<std::vector<const DATA*>>>
listPort;
115 std::vector<const DATA*> _data;
128 template <
class DATA>
150 std::string s =
"A port with id '" +
id +
"' is already registered with node '" + this->
id() +
151 "', ignoring this request.";
197 port.publishNullandClear();
219 std::map<std::string, DataPortHandle<DATA>>
_portMap;
228 #endif //INPUT_NODE_H
std::shared_ptr< OutputPort< DATA > > singlePort
Port used to send a single msg.
Definition: input_node.h:108
size_t size()
Return the size of stored data.
Definition: input_node.h:104
const std::string & id() const
Returns the node 'id'.
Definition: computational_node.h:57
static void info(const FormatString &fmt, const Args &...args)
NRP logging function with message formatting for info level.
Definition: nrp_logger.h:138
void publishAll()
Publish all items in data.
Definition: input_node.h:63
Implementation of an output port in the computation graph.
Definition: output_port.h:36
port
Definition: python_json_engine.py:197
DataPortHandle(const std::string &id, ComputationalNode *parent, size_t queue_size)
Constructor.
Definition: input_node.h:46
bool addMsg(const DATA *msg)
Add a new message to the stored data.
Definition: input_node.h:82
Helper structure managing data and ports associated with a port id.
Definition: input_node.h:39
void publishNullandClear()
Publish a null pointer.
Definition: input_node.h:72
void publishLast()
Publish last item in data.
Definition: input_node.h:54
void clear()
Clear data.
Definition: input_node.h:98
std::shared_ptr< OutputPort< std::vector< const DATA * > > > listPort
Port used to send a list of msgs.
Definition: input_node.h:110
@ Input
Definition: computational_node.h:36
Base class implementing a node in the computational graph.
Definition: computational_node.h:31