Public Member Functions
RTC::PublisherBase Class Reference

Base class of Publisher. More...

#include <PublisherBase.h>

Inheritance diagram for RTC::PublisherBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ReturnCode activate ()=0
 activation
virtual ReturnCode deactivate ()=0
 deactivation
virtual ReturnCode init (coil::Properties &prop)=0
 Initializing configuration.
virtual bool isActive ()=0
 If publisher is active state.
virtual void release ()
 Release the Publisher.
virtual ReturnCode setBuffer (BufferBase< cdrMemoryStream > *buffer)=0
 Setting buffer pointer.
virtual ReturnCode setConsumer (InPortConsumer *consumer)=0
 Store InPort consumer.
virtual ReturnCode setListener (ConnectorInfo &info, ConnectorListeners *listeners)=0
 Set the listener.
virtual ReturnCode write (const cdrMemoryStream &data, unsigned long sec, unsigned long usec)=0
 Write data.
virtual DATAPORTSTATUS_ENUM ~PublisherBase (void)
 Destructor.

Detailed Description

Base class of Publisher.

This is a base class of Publisher*. This class manages data send timing. Variation of Publisher* which implements details of Publisher inherits this PublisherBase class.

Definition at line 63 of file PublisherBase.h.


Constructor & Destructor Documentation

virtual DATAPORTSTATUS_ENUM RTC::PublisherBase::~PublisherBase ( void  ) [inline, virtual]

Destructor.

Definition at line 79 of file PublisherBase.h.


Member Function Documentation

virtual ReturnCode RTC::PublisherBase::activate ( ) [pure virtual]

activation

This function activates the publisher. By calling this function, this publisher starts the thread that pushes data to InPort. If precondition such as initialization process and so on is not met, the error code PRECONDITION_NOT_MET is returned.

Returns:
PORT_OK normal return PRECONDITION_NOT_MET precondition is not met

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, RTC::PublisherNew, RTC::PublisherPeriodic, RTC::PublisherFlush, and OutPortPushConnector::PublisherFlushMock.

virtual ReturnCode RTC::PublisherBase::deactivate ( ) [pure virtual]

deactivation

This function deactivates the publisher. By calling this function, this publisher stops the thread that pushes data to InPort. If precondition such as initialization process and so on is not met, the error code PRECONDITION_NOT_MET is returned.

Returns:
PORT_OK normal return PRECONDITION_NOT_MET precondition is not met

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, RTC::PublisherNew, RTC::PublisherPeriodic, RTC::PublisherFlush, and OutPortPushConnector::PublisherFlushMock.

virtual ReturnCode RTC::PublisherBase::init ( coil::Properties prop) [pure virtual]

Initializing configuration.

This operation would be called to configure in initialization. In the concrete class, configuration should be performed getting appropriate information from the given Properties data. This function might be called right after instantiation and connection sequence respectivly. Therefore, this function should be implemented assuming multiple call.

Parameters:
propConfiguration information

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, OutPortPushConnector::PublisherFlushMock, RTC::PublisherPeriodic, RTC::PublisherNew, and RTC::PublisherFlush.

virtual bool RTC::PublisherBase::isActive ( ) [pure virtual]

If publisher is active state.

A Publisher can be activated/deactivated synchronized with the data port. The active state and the non-active state are made transition by the "activate()" and the "deactivate()" functions respectively. This function confirms if the publisher is in active state.

Returns:
Result of state confirmation (Active state:true, Inactive state:false)

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, RTC::PublisherNew, RTC::PublisherPeriodic, RTC::PublisherFlush, and OutPortPushConnector::PublisherFlushMock.

virtual void RTC::PublisherBase::release ( ) [inline, virtual]

Release the Publisher.

Release this Publisher. When Publisher becomes unnecessary, this is invoked from PublisherFactory.

Definition at line 361 of file PublisherBase.h.

virtual ReturnCode RTC::PublisherBase::setBuffer ( BufferBase< cdrMemoryStream > *  buffer) [pure virtual]

Setting buffer pointer.

This operation sets a buffer that is associated with this object. If the buffer object is NULL, INVALID_ARGS will be returned.

Parameters:
bufferA pointer to a CDR buffer object.
Returns:
ReturnCode PORT_OK normal return INVALID_ARGS given argument has invalid value
virtual ReturnCode RTC::PublisherBase::setConsumer ( InPortConsumer consumer) [pure virtual]

Store InPort consumer.

This operation sets a consumer that is associated with this object. If the consumer object is NULL, INVALID_ARGS will be returned.

Parameters:
consumerA pointer to a consumer object.
Returns:
ReturnCode PORT_OK normal return INVALID_ARGS given argument has invalid value

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, OutPortPushConnector::PublisherFlushMock, RTC::PublisherPeriodic, RTC::PublisherNew, and RTC::PublisherFlush.

virtual ReturnCode RTC::PublisherBase::setListener ( ConnectorInfo info,
ConnectorListeners listeners 
) [pure virtual]

Set the listener.

This function sets ConnectorListeners listener object to the Publisher. By setting ConnectorListeners containing various listeners objects, these listeners are called at the time of reading and writing of a buffer, and transmission of data etc. Since the ownership of the ConnectorListeners object is owned by Port or RTObject, the Publisher never deletes the ConnectorListeners object. If the given ConnectorListeners' pointer is NULL, this function returns INVALID_ARGS.

Parameters:
infoConnectorInfo that is localized object of ConnectorProfile
listenersConnectorListeners that holds various listeners
Returns:
PORT_OK Normal return INVALID_ARGS Invalid arguments

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, OutPortPushConnector::PublisherFlushMock, RTC::PublisherPeriodic, RTC::PublisherNew, and RTC::PublisherFlush.

virtual ReturnCode RTC::PublisherBase::write ( const cdrMemoryStream &  data,
unsigned long  sec,
unsigned long  usec 
) [pure virtual]

Write data.

This function writes data into the Publisher. If this function is called without initializing correctly such as a consumer, listeners, etc., error code PRECONDITION_NOT_MET will be returned and no operation of the writing etc. will be performed.

When publisher writes data, if the consumer returns full-status, returns error, is returned with timeout, error codes BUFFER_FULL, BUFFER_ERROR and BUFFER_TIMEOUT will be returned respectively.

In other cases, PROT_ERROR will be returned.

Parameters:
dataData to be wrote to the buffer
secTimeout time in unit seconds
nsecTimeout time in unit nano-seconds
Returns:
PORT_OK Normal return PRECONDITION_NO_MET Precondition does not met. A consumer, a buffer, listenes are not set properly. SEND_FULL Data was sent but full-status returned SEND_TIMEOUT Data was sent but timeout occurred CONNECTION_LOST detected that the connection has been lost

Implemented in OutPort::PublisherFlushMock, OutPortPushConnector::PublisherNewMock, RTC::PublisherNew, RTC::PublisherPeriodic, RTC::PublisherFlush, and OutPortPushConnector::PublisherFlushMock.


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