Public Member Functions | Private Attributes
RTC::OutPort< DataType > Class Template Reference

OutPort template class. More...

#include <OutPort.h>

Inheritance diagram for RTC::OutPort< DataType >:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

template<class DataType>
class RTC::OutPort< DataType >

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.

Since:
0.2.0

Definition at line 106 of file OutPort.h.


Constructor & Destructor Documentation

template<class DataType>
RTC::OutPort< DataType >::OutPort ( const char *  name,
DataType &  value 
) [inline]

Constructor.

Constructor

Parameters:
namePort's name
valueData variable bound to this port
lengthBuffer length (The default value:8)

Definition at line 133 of file OutPort.h.

template<class DataType>
virtual RTC::OutPort< DataType >::~OutPort ( void  ) [inline, virtual]

Destructor.

Destructor

Definition at line 158 of file OutPort.h.


Member Function Documentation

template<class DataType>
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

Parameters:
indexConnector index
Returns:
Writing status

Definition at line 347 of file OutPort.h.

template<class DataType>
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

Returns:
Writing status list

Definition at line 381 of file OutPort.h.

template<class DataType>
bool RTC::OutPort< DataType >::operator<< ( DataType &  value) [inline]

Write data.

Write data to the port. Write the set value to the port.

Parameters:
valueThe target data for writing
Returns:
Writing result (Successful:true, Failed:false)

Definition at line 310 of file OutPort.h.

template<class DataType>
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.

Parameters:
on_writeOnWrite callback functor

Definition at line 415 of file OutPort.h.

template<class DataType>
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.

Parameters:
on_wconvertOnWriteConvert callback functor

Definition at line 456 of file OutPort.h.

template<class DataType>
virtual bool RTC::OutPort< DataType >::write ( DataType &  value) [inline, virtual]

Write data.

Write data in the port.

  • When callback functor OnWrite is already set, OnWrite will be invoked before writing into the buffer held by OutPort.
  • When the buffer held by OutPort can detect the overflow, and when it detected the overflow at writing, callback functor OnOverflow will be invoked.
  • When callback functor OnWriteConvert is already set, the return value of operator() of OnWriteConvert will be written into the buffer at the writing.
Parameters:
valueThe target data for writing
Returns:
Writing result (Successful:true, Failed:false)

Definition at line 203 of file OutPort.h.

template<class DataType>
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.

Returns:
Writing result (Successful:true, Failed:false)

Implements RTC::OutPortBase.

Definition at line 280 of file OutPort.h.


Member Data Documentation

template<class DataType>
coil::TimeMeasure RTC::OutPort< DataType >::m_cdrtime [private]

Definition at line 490 of file OutPort.h.

template<class DataType>
OnWrite<DataType>* RTC::OutPort< DataType >::m_onWrite [private]

Pointer to OnWrite callback functor.

Definition at line 479 of file OutPort.h.

template<class DataType>
OnWriteConvert<DataType>* RTC::OutPort< DataType >::m_onWriteConvert [private]

Pointer to OnWriteConvert callback functor.

Definition at line 488 of file OutPort.h.

template<class DataType>
DataPortStatusList RTC::OutPort< DataType >::m_status [private]

Definition at line 492 of file OutPort.h.

template<class DataType>
std::string RTC::OutPort< DataType >::m_typename [private]

Definition at line 462 of file OutPort.h.

template<class DataType>
DataType& RTC::OutPort< DataType >::m_value [private]

The reference to type-T variable that is bound.

Definition at line 470 of file OutPort.h.


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


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sun Mar 26 2017 03:37:20