OutPort template class. More...
#include <OutPort.h>
Public Member Functions | |
DataPortStatus::Enum | getStatus (int index) |
Getting specified connector's writing status. | |
DataPortStatusList | getStatusList () |
Getting specified connector's writing status list. | |
bool | operator<< (DataType &value) |
Write data. | |
OutPort (const char *name, DataType &value) | |
Constructor. | |
void | setOnWrite (OnWrite< DataType > *on_write) |
Set OnWrite callback. | |
void | setOnWriteConvert (OnWriteConvert< DataType > *on_wconvert) |
Set OnWriteConvert callback. | |
virtual bool | write (DataType &value) |
Write data. | |
bool | write () |
Write data. | |
virtual | ~OutPort (void) |
Destructor. | |
Private Attributes | |
coil::TimeMeasure | m_cdrtime |
OnWrite< DataType > * | m_onWrite |
Pointer to OnWrite callback functor. | |
OnWriteConvert< DataType > * | m_onWriteConvert |
Pointer to OnWriteConvert callback functor. | |
DataPortStatusList | m_status |
std::string | m_typename |
DataType & | m_value |
The reference to type-T variable that is bound. |
OutPort template class.
This is the OutPort template class. The data type "DateType" supported by OutPort and the buffer type "BufferType" are used as template arguments.
RTC::OutPort< DataType >::OutPort | ( | const char * | name, |
DataType & | value | ||
) | [inline] |
virtual RTC::OutPort< DataType >::~OutPort | ( | void | ) | [inline, virtual] |
DataPortStatus::Enum RTC::OutPort< DataType >::getStatus | ( | int | index | ) | [inline] |
Getting specified connector's writing status.
An OutPort has Connectors that are virtual data stream channel for each connection. "write()" function write into these Connectors, and each Connector returns writing-status. write() function will return a true value if all Connectors return normal status, and a false value will be returned if at least one Connector failed. This function can be used to inspect each return status
index | Connector index |
DataPortStatusList RTC::OutPort< DataType >::getStatusList | ( | ) | [inline] |
Getting specified connector's writing status list.
An OutPort has Connectors that are virtual data stream channel for each connection. "write()" function write into these Connectors, and each Connector returns writing-status. write() function will return a true value if all Connectors return normal status, and a false value will be returned if at least one Connector failed. This function can be used to inspect each return status
bool RTC::OutPort< DataType >::operator<< | ( | DataType & | value | ) | [inline] |
void RTC::OutPort< DataType >::setOnWrite | ( | OnWrite< DataType > * | on_write | ) | [inline] |
Set OnWrite callback.
This operation sets the OnWrite callback functor that is called just before write() operation call. The ownership of the functor object is owned by caller of this operation. Therefore caller have to destruct the callback functor object by itself. Giving 0 as an argument for this operation, callback will be disabled.
on_write | OnWrite callback functor |
void RTC::OutPort< DataType >::setOnWriteConvert | ( | OnWriteConvert< DataType > * | on_wconvert | ) | [inline] |
Set OnWriteConvert callback.
This operation sets the OnWriteConvert callback functor that converts given data and is called just before write() operation call. A recent data is given to argument and return data will be written into connector or its buffer. The ownership of the functor object is owned by caller of this operation. Therefore caller have to destruct the callback functor object by itself. Giving 0 as an argument for this operation, callback will be disabled.
on_wconvert | OnWriteConvert callback functor |
virtual bool RTC::OutPort< DataType >::write | ( | DataType & | value | ) | [inline, virtual] |
Write data.
Write data in the port.
value | The target data for writing |
bool RTC::OutPort< DataType >::write | ( | ) | [inline, virtual] |
Write data.
Write data to the port. Write the value, which was set to the bound variable, to the port.
Implements RTC::OutPortBase.
coil::TimeMeasure RTC::OutPort< DataType >::m_cdrtime [private] |
OnWrite<DataType>* RTC::OutPort< DataType >::m_onWrite [private] |
OnWriteConvert<DataType>* RTC::OutPort< DataType >::m_onWriteConvert [private] |
Pointer to OnWriteConvert callback functor.
DataPortStatusList RTC::OutPort< DataType >::m_status [private] |
std::string RTC::OutPort< DataType >::m_typename [private] |
DataType& RTC::OutPort< DataType >::m_value [private] |