RTC::OutPort< DataType > Class Template Reference

OutPort template class. More...

#include <OutPort.h>

Inheritance diagram for RTC::OutPort< DataType >:
RTC::OutPortBase RTC::PortBase RTC::DataPortStatus

List of all members.

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.

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

Constructor & Destructor Documentation

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

Constructor.

Constructor

Parameters:
name Port's name
value Data variable bound to this port
length Buffer length (The default value:8)

References RTC::PortBase::addProperty(), NVUtil::find_index(), and RTC::PortBase::m_profile.

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

Destructor.

Destructor


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:
index Connector index
Returns:
Writing status
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
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:
value The target data for writing
Returns:
Writing result (Successful:true, Failed:false)

References RTC::OutPort< DataType >::write().

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_write OnWrite callback functor
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_wconvert OnWriteConvert callback functor
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.

Referenced by RTC::OutPort< DataType >::operator<<().

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:
value The target data for writing
Returns:
Writing result (Successful:true, Failed:false)

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::PortBase::m_profile, RTC::DataPortStatus::PORT_OK, RTC_DEBUG, RTC_TRACE, and RTC_WARN.

Generated on Fri Oct 28 18:31:18 2016 for OpenRTM-aist by  doxygen 1.6.3