PublisherNew class. More...
#include <PublisherNew.h>
Public Types | |
typedef coil::Mutex | Mutex |
typedef coil::Condition< Mutex > | Condition |
typedef coil::Guard< coil::Mutex > | Guard |
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. |
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.
typedef coil::Mutex RTC::PublisherNew::Mutex |
enum RTC::PublisherNew::Policy [protected] |
Task start function.
ACE_Task::open() override function. Create newly thread for this Publisher.
args | Thread creation arguments (Unused in this Publisher) |
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.
DATAPORTSTATUS_ENUM RTC::PublisherNew::PublisherNew | ( | ) |
Constructor.
Constructor Create new thread for this Publisher.
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
virtual ReturnCode RTC::PublisherNew::activate | ( | ) | [virtual] |
ReturnCode RTC::PublisherNew::convertReturn | ( | BufferStatus::Enum | status, | |
const cdrMemoryStream & | data | |||
) | [protected] |
return code conversion (BufferStatus -> DataPortStatus)
bool RTC::PublisherNew::createTask | ( | const coil::Properties & | prop | ) | [protected] |
Setting Task.
virtual ReturnCode RTC::PublisherNew::deactivate | ( | ) | [virtual] |
virtual ReturnCode RTC::PublisherNew::init | ( | coil::Properties & | prop | ) | [virtual] |
initialization
Implements RTC::PublisherBase.
ReturnCode RTC::PublisherNew::invokeListener | ( | DataPortStatus::Enum | status, | |
const cdrMemoryStream & | data | |||
) | [protected] |
This method calls the function notified the listener according to DataPortStatus.
status | DataPortStatus | |
data | cdrMemoryStream |
virtual bool RTC::PublisherNew::isActive | ( | ) | [virtual] |
Confirm to activate.
Confirm that has been activated.
Implements RTC::PublisherBase.
void RTC::PublisherNew::onBufferFull | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_BUFFER_FULL.
data | cdrMemoryStream |
References RTC::ON_BUFFER_FULL.
void RTC::PublisherNew::onBufferRead | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_BUFFER_READ.
data | cdrMemoryStream |
References RTC::ON_BUFFER_READ.
void RTC::PublisherNew::onBufferWrite | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
Connector data listener functions.
This method is notified to listeners of ON_BUFFER_WRITE.
data | cdrMemoryStream |
References RTC::ON_BUFFER_WRITE.
void RTC::PublisherNew::onBufferWriteOverwrite | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_BUFFER_OVERWRITE.
data | cdrMemoryStream |
References RTC::ON_BUFFER_OVERWRITE.
void RTC::PublisherNew::onBufferWriteTimeout | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_BUFFER_WRITE_TIMEOUT.
data | cdrMemoryStream |
References RTC::ON_BUFFER_WRITE_TIMEOUT.
void RTC::PublisherNew::onReceived | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_RECEIVED.
data | cdrMemoryStream |
References RTC::ON_RECEIVED.
void RTC::PublisherNew::onReceiverError | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_RECEIVER_ERROR.
data | cdrMemoryStream |
References RTC::ON_RECEIVER_ERROR.
void RTC::PublisherNew::onReceiverFull | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_RECEIVER_FULL.
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.
data | cdrMemoryStream |
References RTC::ON_RECEIVER_TIMEOUT.
void RTC::PublisherNew::onSend | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_SEND.
data | cdrMemoryStream |
References RTC::ON_SEND.
void RTC::PublisherNew::onSenderError | ( | ) | [inline, protected] |
Connector listener functions.
This method is notified to listeners of ON_SENDER_ERROR.
data | cdrMemoryStream |
References RTC::ON_SENDER_ERROR.
ReturnCode RTC::PublisherNew::pushAll | ( | ) | [protected] |
push "all" policy
ReturnCode RTC::PublisherNew::pushFifo | ( | ) | [protected] |
push "fifo" policy
ReturnCode RTC::PublisherNew::pushNew | ( | ) | [protected] |
push "new" policy
ReturnCode RTC::PublisherNew::pushSkip | ( | ) | [protected] |
push "skip" policy
virtual ReturnCode RTC::PublisherNew::setBuffer | ( | CdrBufferBase * | buffer | ) | [virtual] |
Setting buffer pointer.
buffer | CDR buffer |
virtual ReturnCode RTC::PublisherNew::setConsumer | ( | InPortConsumer * | consumer | ) | [virtual] |
Store InPort consumer.
Implements RTC::PublisherBase.
virtual ReturnCode RTC::PublisherNew::setListener | ( | ConnectorInfo & | info, | |
ConnectorListeners * | listeners | |||
) | [virtual] |
Set the listener.
info | ConnectorInfo | |
listeners | ConnectorListeners |
Implements RTC::PublisherBase.
void RTC::PublisherNew::setPushPolicy | ( | const coil::Properties & | prop | ) | [protected] |
Setting PushPolicy.
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.
virtual ReturnCode RTC::PublisherNew::write | ( | const cdrMemoryStream & | data, | |
unsigned long | sec, | |||
unsigned long | usec | |||
) | [virtual] |
Write data.
data | Data | |
sec | Timeout period | |
nsec | Timeout period |
Implements RTC::PublisherBase.