NRP Core  1.4.1
DataPortHandle< DATA > Struct Template Reference

Helper structure managing data and ports associated with a port id. More...

#include <input_node.h>

Public Member Functions

 DataPortHandle ()=delete
 
 DataPortHandle (const std::string &id, ComputationalNode *parent, size_t queue_size)
 Constructor. More...
 
void publishLast ()
 Publish last item in data. More...
 
void publishAll ()
 Publish all items in data. More...
 
void publishNullandClear ()
 Publish a null pointer. More...
 
bool addMsg (const DATA *msg)
 Add a new message to the stored data. More...
 
void clear ()
 Clear data. More...
 
size_t size ()
 Return the size of stored data. More...
 

Public Attributes

std::shared_ptr< OutputPort< DATA > > singlePort
 Port used to send a single msg. More...
 
std::shared_ptr< OutputPort< std::vector< const DATA * > > > listPort
 Port used to send a list of msgs. More...
 

Detailed Description

template<class DATA>
struct DataPortHandle< DATA >

Helper structure managing data and ports associated with a port id.

Constructor & Destructor Documentation

◆ DataPortHandle() [1/2]

template<class DATA >
DataPortHandle< DATA >::DataPortHandle ( )
delete

◆ DataPortHandle() [2/2]

template<class DATA >
DataPortHandle< DATA >::DataPortHandle ( const std::string &  id,
ComputationalNode parent,
size_t  queue_size 
)
inline

Constructor.

Member Function Documentation

◆ addMsg()

template<class DATA >
bool DataPortHandle< DATA >::addMsg ( const DATA *  msg)
inline

Add a new message to the stored data.

◆ clear()

template<class DATA >
void DataPortHandle< DATA >::clear ( )
inline

Clear data.

◆ publishAll()

template<class DATA >
void DataPortHandle< DATA >::publishAll ( )
inline

Publish all items in data.

◆ publishLast()

template<class DATA >
void DataPortHandle< DATA >::publishLast ( )
inline

Publish last item in data.

◆ publishNullandClear()

template<class DATA >
void DataPortHandle< DATA >::publishNullandClear ( )
inline

Publish a null pointer.

◆ size()

template<class DATA >
size_t DataPortHandle< DATA >::size ( )
inline

Return the size of stored data.

Member Data Documentation

◆ listPort

template<class DATA >
std::shared_ptr<OutputPort<std::vector<const DATA*> > > DataPortHandle< DATA >::listPort

Port used to send a list of msgs.

◆ singlePort

template<class DATA >
std::shared_ptr<OutputPort<DATA> > DataPortHandle< DATA >::singlePort

Port used to send a single msg.


The documentation for this struct was generated from the following file: