RTC::PublisherNew Class Reference

PublisherNew class. More...

#include <PublisherNew.h>

Inheritance diagram for RTC::PublisherNew:

RTC::PublisherBase RTC::DataPortStatus

List of all members.

Public Types

typedef coil::Mutex Mutex
typedef coil::Condition< MutexCondition
typedef coil::Guard< coil::MutexGuard

Public Member Functions

DATAPORTSTATUS_ENUM PublisherNew ()
 Constructor.
virtual ~PublisherNew (void)
 Destructor.
virtual ReturnCode init (coil::Properties &prop)
 initialization
virtual ReturnCode setConsumer (InPortConsumer *consumer)
 Store InPort consumer.
virtual ReturnCode setBuffer (CdrBufferBase *buffer)
 Setting buffer pointer.
virtual ReturnCode setListener (ConnectorInfo &info, ConnectorListeners *listeners)
 Set the listener.
virtual ReturnCode write (const cdrMemoryStream &data, unsigned long sec, unsigned long usec)
 Write data.
virtual bool isActive ()
 Confirm to activate.
virtual ReturnCode activate ()
 activation
virtual ReturnCode deactivate ()
 deactivation
virtual int svc (void)
 Thread execution function.

Protected Types

enum  Policy { ALL, FIFO, SKIP, NEW }
 Task start function. More...

Protected Member Functions

void setPushPolicy (const coil::Properties &prop)
 Setting PushPolicy.
bool createTask (const coil::Properties &prop)
 Setting Task.
ReturnCode pushAll ()
 push "all" policy
ReturnCode pushFifo ()
 push "fifo" policy
ReturnCode pushSkip ()
 push "skip" policy
ReturnCode pushNew ()
 push "new" policy
ReturnCode convertReturn (BufferStatus::Enum status, const cdrMemoryStream &data)
 return code conversion (BufferStatus -> DataPortStatus)
ReturnCode invokeListener (DataPortStatus::Enum status, const cdrMemoryStream &data)
 This method calls the function notified the listener according to DataPortStatus.
void onBufferWrite (const cdrMemoryStream &data)
 Connector data listener functions.
void onBufferFull (const cdrMemoryStream &data)
 This method is notified to listeners of ON_BUFFER_FULL.
void onBufferWriteTimeout (const cdrMemoryStream &data)
 This method is notified to listeners of ON_BUFFER_WRITE_TIMEOUT.
void onBufferWriteOverwrite (const cdrMemoryStream &data)
 This method is notified to listeners of ON_BUFFER_OVERWRITE.
void onBufferRead (const cdrMemoryStream &data)
 This method is notified to listeners of ON_BUFFER_READ.
void onSend (const cdrMemoryStream &data)
 This method is notified to listeners of ON_SEND.
void onReceived (const cdrMemoryStream &data)
 This method is notified to listeners of ON_RECEIVED.
void onReceiverFull (const cdrMemoryStream &data)
 This method is notified to listeners of ON_RECEIVER_FULL.
void onReceiverTimeout (const cdrMemoryStream &data)
 This method is notified to listeners of ON_RECEIVER_TIMEOUT.
void onReceiverError (const cdrMemoryStream &data)
 This method is notified to listeners of ON_RECEIVER_ERROR.
void onSenderError ()
 Connector listener functions.


Detailed Description

PublisherNew class.

Send new data at timing of when it is stored into the buffer. This class is used when operating Consumer that waits for the data send timing in different thread from one of the send side. Publisher's driven is blocked until the data send timing reaches, if the send timing notification is received, the Consumer's send processing will be invoked immediately.


Member Typedef Documentation


Member Enumeration Documentation

enum RTC::PublisherNew::Policy [protected]

Task start function.

ACE_Task::open() override function. Create newly thread for this Publisher.

Parameters:
args Thread creation arguments (Unused in this Publisher)
Returns:
Execution result
Task terminate function ACE_Task::release() override function. Set 2driven flag to false, and terminate this Publisher's operation. However, if the driven thread is blocked, Consumer's send processing may be invoked maximum once.
Enumerator:
ALL 
FIFO 
SKIP 
NEW 


Constructor & Destructor Documentation

DATAPORTSTATUS_ENUM RTC::PublisherNew::PublisherNew (  ) 

Constructor.

Constructor Create new thread for this Publisher.

Parameters:
consumer Consumer that waits for the data sending
property Property object that is configured this Publisher's control information.(Unused in this Publisher)

virtual RTC::PublisherNew::~PublisherNew ( void   )  [virtual]

Destructor.

Destructor


Member Function Documentation

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

initialization

Implements RTC::PublisherBase.

virtual ReturnCode RTC::PublisherNew::setConsumer ( InPortConsumer consumer  )  [virtual]

Store InPort consumer.

Implements RTC::PublisherBase.

virtual ReturnCode RTC::PublisherNew::setBuffer ( CdrBufferBase buffer  )  [virtual]

Setting buffer pointer.

Parameters:
buffer CDR buffer
Returns:
PORT_OK 正常終了 INVALID_ARGS 不正な引数

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

Set the listener.

Parameters:
info ConnectorInfo
listeners ConnectorListeners
Returns:
PORT_OK Normal return INVALID_ARGS Invalid arguments

Implements RTC::PublisherBase.

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

Write data.

Parameters:
data Data
sec Timeout period
nsec Timeout period
Returns:
Return code

Implements RTC::PublisherBase.

virtual bool RTC::PublisherNew::isActive (  )  [virtual]

Confirm to activate.

Confirm that has been activated.

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

Implements RTC::PublisherBase.

virtual ReturnCode RTC::PublisherNew::activate (  )  [virtual]

activation

Returns:
Return code

Implements RTC::PublisherBase.

virtual ReturnCode RTC::PublisherNew::deactivate (  )  [virtual]

deactivation

Returns:
Return code

Implements RTC::PublisherBase.

virtual int RTC::PublisherNew::svc ( void   )  [virtual]

Thread execution function.

ACE_Task::svc() override function. Make thread stand by until data in the buffer is updated.

Returns:
Execution result

void RTC::PublisherNew::setPushPolicy ( const coil::Properties prop  )  [protected]

Setting PushPolicy.

bool RTC::PublisherNew::createTask ( const coil::Properties prop  )  [protected]

Setting Task.

ReturnCode RTC::PublisherNew::pushAll (  )  [protected]

push "all" policy

ReturnCode RTC::PublisherNew::pushFifo (  )  [protected]

push "fifo" policy

ReturnCode RTC::PublisherNew::pushSkip (  )  [protected]

push "skip" policy

ReturnCode RTC::PublisherNew::pushNew (  )  [protected]

push "new" policy

ReturnCode RTC::PublisherNew::convertReturn ( BufferStatus::Enum  status,
const cdrMemoryStream &  data 
) [protected]

return code conversion (BufferStatus -> DataPortStatus)

ReturnCode RTC::PublisherNew::invokeListener ( DataPortStatus::Enum  status,
const cdrMemoryStream &  data 
) [protected]

This method calls the function notified the listener according to DataPortStatus.

Parameters:
status DataPortStatus
data cdrMemoryStream
Returns:
Return code

void RTC::PublisherNew::onBufferWrite ( const cdrMemoryStream &  data  )  [inline, protected]

Connector data listener functions.

This method is notified to listeners of ON_BUFFER_WRITE.

Parameters:
data cdrMemoryStream

References RTC::ON_BUFFER_WRITE.

void RTC::PublisherNew::onBufferFull ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_BUFFER_FULL.

Parameters:
data cdrMemoryStream

References RTC::ON_BUFFER_FULL.

void RTC::PublisherNew::onBufferWriteTimeout ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_BUFFER_WRITE_TIMEOUT.

Parameters:
data cdrMemoryStream

References RTC::ON_BUFFER_WRITE_TIMEOUT.

void RTC::PublisherNew::onBufferWriteOverwrite ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_BUFFER_OVERWRITE.

Parameters:
data cdrMemoryStream

References RTC::ON_BUFFER_OVERWRITE.

void RTC::PublisherNew::onBufferRead ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_BUFFER_READ.

Parameters:
data cdrMemoryStream

References RTC::ON_BUFFER_READ.

void RTC::PublisherNew::onSend ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_SEND.

Parameters:
data cdrMemoryStream

References RTC::ON_SEND.

void RTC::PublisherNew::onReceived ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_RECEIVED.

Parameters:
data cdrMemoryStream

References RTC::ON_RECEIVED.

void RTC::PublisherNew::onReceiverFull ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_RECEIVER_FULL.

Parameters:
data cdrMemoryStream

References RTC::ON_RECEIVER_FULL.

void RTC::PublisherNew::onReceiverTimeout ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_RECEIVER_TIMEOUT.

Parameters:
data cdrMemoryStream

References RTC::ON_RECEIVER_TIMEOUT.

void RTC::PublisherNew::onReceiverError ( const cdrMemoryStream &  data  )  [inline, protected]

This method is notified to listeners of ON_RECEIVER_ERROR.

Parameters:
data cdrMemoryStream

References RTC::ON_RECEIVER_ERROR.

void RTC::PublisherNew::onSenderError (  )  [inline, protected]

Connector listener functions.

This method is notified to listeners of ON_SENDER_ERROR.

Parameters:
data cdrMemoryStream

References RTC::ON_SENDER_ERROR.


Generated on Thu Jan 28 13:25:36 2010 for OpenRTM by  doxygen 1.5.5