#include <PublisherPeriodic.h>
Public Types | |
typedef coil::Mutex | Mutex |
typedef coil::Condition< Mutex > | Condition |
typedef coil::Guard< coil::Mutex > | Guard |
Public Member Functions | |
DATAPORTSTATUS_ENUM | PublisherPeriodic () |
Constructor. | |
virtual | ~PublisherPeriodic (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 } |
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 | 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 | onBufferEmpty () |
Connector listener functions. | |
void | onSenderEmpty () |
This method is notified to listeners of ON_SENDER_EMPTY. | |
void | onSenderError () |
This method is notified to listeners of ON_SENDER_ERROR. |
Publisher that invokes the consumer's sending process periodically. This is used when the data sending is regularly executed.
enum RTC::PublisherPeriodic::Policy [protected] |
DATAPORTSTATUS_ENUM RTC::PublisherPeriodic::PublisherPeriodic | ( | ) |
Constructor.
The intervals of invoking send processing needs to be set in dataport.publisher.push_rate of Property object. The interval is specified by floating point string in Hz. For example, "1000.0" is set for 1000.0Hz. If the above property is unset, "1000Hz" will be set.
consumer | Consumer which waits for data sending | |
property | Property objects that are set the control information of this Publisher |
virtual RTC::PublisherPeriodic::~PublisherPeriodic | ( | void | ) | [virtual] |
Destructor.
Destructor
virtual ReturnCode RTC::PublisherPeriodic::init | ( | coil::Properties & | prop | ) | [virtual] |
virtual ReturnCode RTC::PublisherPeriodic::setConsumer | ( | InPortConsumer * | consumer | ) | [virtual] |
virtual ReturnCode RTC::PublisherPeriodic::setBuffer | ( | CdrBufferBase * | buffer | ) | [virtual] |
Setting buffer pointer.
buffer | CDR buffer |
virtual ReturnCode RTC::PublisherPeriodic::setListener | ( | ConnectorInfo & | info, | |
ConnectorListeners * | listeners | |||
) | [virtual] |
Set the listener.
info | ConnectorInfo | |
listeners | ConnectorListeners |
Implements RTC::PublisherBase.
virtual ReturnCode RTC::PublisherPeriodic::write | ( | const cdrMemoryStream & | data, | |
unsigned long | sec, | |||
unsigned long | usec | |||
) | [virtual] |
Write data.
data | Data | |
sec | Timeout period | |
nsec | Timeout period |
Implements RTC::PublisherBase.
virtual bool RTC::PublisherPeriodic::isActive | ( | ) | [virtual] |
Confirm to activate.
Confirm that has been activated.
Implements RTC::PublisherBase.
virtual ReturnCode RTC::PublisherPeriodic::activate | ( | ) | [virtual] |
virtual ReturnCode RTC::PublisherPeriodic::deactivate | ( | ) | [virtual] |
virtual int RTC::PublisherPeriodic::svc | ( | void | ) | [virtual] |
Thread execution function.
ACE_Task::svc() override function.
void RTC::PublisherPeriodic::setPushPolicy | ( | const coil::Properties & | prop | ) | [protected] |
Setting PushPolicy.
bool RTC::PublisherPeriodic::createTask | ( | const coil::Properties & | prop | ) | [protected] |
Setting Task.
ReturnCode RTC::PublisherPeriodic::pushAll | ( | ) | [protected] |
push "all" policy
ReturnCode RTC::PublisherPeriodic::pushFifo | ( | ) | [protected] |
push "fifo" policy
ReturnCode RTC::PublisherPeriodic::pushSkip | ( | ) | [protected] |
push "skip" policy
ReturnCode RTC::PublisherPeriodic::pushNew | ( | ) | [protected] |
push "new" policy
ReturnCode RTC::PublisherPeriodic::convertReturn | ( | BufferStatus::Enum | status, | |
const cdrMemoryStream & | data | |||
) | [protected] |
return code conversion (BufferStatus -> DataPortStatus)
ReturnCode RTC::PublisherPeriodic::invokeListener | ( | DataPortStatus::Enum | status, | |
const cdrMemoryStream & | data | |||
) | [protected] |
This method calls the function notified the listener according to DataPortStatus.
status | DataPortStatus | |
data | cdrMemoryStream |
void RTC::PublisherPeriodic::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::PublisherPeriodic::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::PublisherPeriodic::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::PublisherPeriodic::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::PublisherPeriodic::onSend | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_SEND.
data | cdrMemoryStream |
References RTC::ON_SEND.
void RTC::PublisherPeriodic::onReceived | ( | const cdrMemoryStream & | data | ) | [inline, protected] |
This method is notified to listeners of ON_RECEIVED.
data | cdrMemoryStream |
References RTC::ON_RECEIVED.
void RTC::PublisherPeriodic::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::PublisherPeriodic::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::PublisherPeriodic::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::PublisherPeriodic::onBufferEmpty | ( | ) | [inline, protected] |
Connector listener functions.
This method is notified to listeners of ON_BUFFER_EMPTY.
References RTC::ON_BUFFER_EMPTY.
void RTC::PublisherPeriodic::onSenderEmpty | ( | ) | [inline, protected] |
void RTC::PublisherPeriodic::onSenderError | ( | ) | [inline, protected] |