OutPort template class. More...
#include <OutPort.h>
Public Member Functions | |
OutPort (const char *name, DataType &value) | |
Constructor. | |
virtual | ~OutPort (void) |
Destructor. | |
virtual bool | write (DataType &value) |
Write data. | |
bool | write () |
Write data. | |
bool | operator<< (DataType &value) |
Write data. | |
DataPortStatus::Enum | getStatus (int index) |
Getting specified connector's writing status. | |
DataPortStatusList | getStatusList () |
Getting specified connector's writing status list. | |
void | setOnWrite (OnWrite< DataType > *on_write) |
Set OnWrite callback. | |
void | setOnWriteConvert (OnWriteConvert< DataType > *on_wconvert) |
Set OnWriteConvert callback. |
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] |
Constructor.
Constructor
name | Port's name | |
value | Data variable bound to this port | |
length | Buffer length (The default value:8) |
virtual RTC::OutPort< DataType >::~OutPort | ( | void | ) | [inline, virtual] |
Destructor.
Destructor
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] |
Write data.
Write data to the port. Write the set value to the port.
value | The target data for writing |
References RTC::OutPort< DataType >::write().
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 |
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.
Referenced by RTC::OutPort< DataType >::operator<<().
virtual bool RTC::OutPort< DataType >::write | ( | DataType & | value | ) | [inline, virtual] |
Write data.
Write data in the port.
value | The target data for writing |
References RTC::DataPortStatus::CONNECTION_LOST, RTC::PortBase::disconnect(), RTC::PortBase::findConnProfile(), CORBA_SeqUtil::for_each(), RTC::OutPortBase::m_connectors, RTC::PortBase::m_connectorsMutex, RTC::PortBase::m_onConnectionLost, RTC::DataPortStatus::PORT_OK, RTC_DEBUG, RTC_TRACE, and RTC_WARN.