PublisherNew class. More...
Public Member Functions | |
def | __del__ (self) |
Destructor. More... | |
def | __init__ (self) |
Constructor. More... | |
def | activate (self) |
activation More... | |
def | convertReturn (self, status, data) |
Convertion from BufferStatus to DataPortStatus. More... | |
def | createTask (self, prop) |
Setting Taskbool PublisherNew::createTask(const coil::Properties& prop) More... | |
def | deactivate (self) |
deactivation More... | |
def | init (self, prop) |
Initialization. More... | |
def | invokeListener (self, status, data) |
Call listeners according to the DataPortStatus. More... | |
def | isActive (self) |
If publisher is active state. More... | |
def | onBufferFull (self, data) |
Notify an ON_BUFFER_FULL event to listeners. More... | |
def | onBufferRead (self, data) |
Notify an ON_BUFFER_READ event to listeners. More... | |
def | onBufferWrite (self, data) |
Notify an ON_BUFFER_WRITE event to listeners. More... | |
def | onBufferWriteOverwrite (self, data) |
Notify an ON_BUFFER_OVERWRITE event to listeners. More... | |
def | onBufferWriteTimeout (self, data) |
Notify an ON_BUFFER_WRITE_TIMEOUT event to listeners. More... | |
def | onReceived (self, data) |
Notify an ON_RECEIVED event to listeners. More... | |
def | onReceiverError (self, data) |
Notify an ON_RECEIVER_ERROR event to listeners. More... | |
def | onReceiverFull (self, data) |
Notify an ON_RECEIVER_FULL event to listeners. More... | |
def | onReceiverTimeout (self, data) |
Notify an ON_RECEIVER_TIMEOUT event to listeners. More... | |
def | onSend (self, data) |
Notify an ON_SEND event to listners. More... | |
def | onSenderError (self) |
Notify an ON_SENDER_ERROR event to listeners. More... | |
def | pushAll (self) |
push all policy More... | |
def | pushFifo (self) |
push "fifo" policy More... | |
def | pushNew (self) |
push "new" policy More... | |
def | pushSkip (self) |
push "skip" policy More... | |
def | setBuffer (self, buffer) |
Setting buffer pointer. More... | |
def | setConsumer (self, consumer) |
Store InPort consumer. More... | |
def | setListener (self, info, listeners) |
Set the listener. More... | |
def | setPushPolicy (self, prop) |
Setting PushPolicyvoid PublisherNew::setPushPolicy(const coil::Properties& prop) More... | |
def | svc (self) |
Thread execution function. More... | |
def | write (self, data, sec, usec) |
Write data. More... | |
Public Member Functions inherited from OpenRTM_aist.PublisherBase.PublisherBase | |
def | activate (self) |
virtual ReturnCode activate() = 0; More... | |
def | deactivate (self) |
virtual ReturnCode deactivate() = 0; More... | |
def | init (self, prop) |
Initializing configuration. More... | |
def | isActive (self) |
virtual bool isActive() = 0; More... | |
def | release (self) |
Release the Publisher. More... | |
def | setBuffer (self, buffer) |
virtual ReturnCode setBuffer(BufferBase<cdrMemoryStream>* buffer) = 0; More... | |
def | setConsumer (self, consumer) |
virtual ReturnCode setConsumer(InPortConsumer* consumer) = 0; More... | |
def | setListener (self, info, listeners) |
def | write (self, data, sec, usec) |
Public Member Functions inherited from OpenRTM_aist.DataPortStatus.DataPortStatus | |
def | __init__ (self) |
def | toString (status) |
Convert DataPortStatus into the string. More... | |
Static Public Attributes | |
int | ALL = 0 |
int | FIFO = 1 |
int | NEW = 3 |
int | SKIP = 2 |
Static Public Attributes inherited from OpenRTM_aist.DataPortStatus.DataPortStatus | |
int | BUFFER_EMPTY = 4 |
int | BUFFER_ERROR = 2 |
int | BUFFER_FULL = 3 |
int | BUFFER_TIMEOUT = 5 |
int | CONNECTION_LOST = 12 |
int | INVALID_ARGS = 10 |
int | PORT_ERROR = 1 |
int | PORT_OK = 0 |
DataPortStatus return codes. More... | |
int | PRECONDITION_NOT_MET = 11 |
int | RECV_EMPTY = 8 |
int | RECV_TIMEOUT = 9 |
int | SEND_FULL = 6 |
int | SEND_TIMEOUT = 7 |
toString = staticmethod(toString) | |
int | UNKNOWN_ERROR = 13 |
Private Attributes | |
_active | |
_buffer | |
_consumer | |
_leftskip | |
_listeners | |
_profile | |
_pushPolicy | |
_retcode | |
_retmutex | |
_rtcout | |
_skipn | |
_task | |
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.
Definition at line 46 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.__init__ | ( | self | ) |
Constructor.
Definition at line 70 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.__del__ | ( | self | ) |
Destructor.
Definition at line 96 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.activate | ( | self | ) |
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.
PublisherBase::ReturnCode PublisherNew::activate()
Definition at line 543 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.convertReturn | ( | self, | |
status, | |||
data | |||
) |
Convertion from BufferStatus to DataPortStatus.
This function converts return value from the buffer to DataPortStatus::Enum typed return value. The conversion rule is as follows. Callback functions are also shown, if it exists.
status | BufferStatus |
data | cdrMemoryStream |
PublisherBase::ReturnCode PublisherNew::convertReturn(BufferStatus::Enum status, const cdrMemoryStream& data) BufferStatus -> DataPortStatus
BUFFER_OK -> PORT_OK BUFFER_ERROR -> BUFFER_ERROR BUFFER_FULL -> BUFFER_FULL NOT_SUPPORTED -> PORT_ERROR TIMEOUT -> BUFFER_TIMEOUT PRECONDITION_NOT_MET -> PRECONDITION_NOT_MET
Definition at line 804 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.createTask | ( | self, | |
prop | |||
) |
Setting Taskbool PublisherNew::createTask(const coil::Properties& prop)
Definition at line 167 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.deactivate | ( | self | ) |
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.
PublisherBase::ReturnCode PublisherNew::deactivate()
Definition at line 573 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.init | ( | self, | |
prop | |||
) |
Initialization.
This function have to be called before using this class object. Properties object that includes certain configuration information should be given as an argument. all, fifo, skip, new can be given as a data push policy in a value of the key "publisher.push_policy."
The following options are available.
property | Property objects that includes the control information of this Publisher |
PublisherBase::ReturnCode PublisherNew::init(coil::Properties& prop)
Definition at line 257 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.invokeListener | ( | self, | |
status, | |||
data | |||
) |
Call listeners according to the DataPortStatus.
status | DataPortStatus |
data | cdrMemoryStream |
PublisherNew::ReturnCode PublisherNew::invokeListener(DataPortStatus::Enum status, const cdrMemoryStream& data)
Definition at line 858 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.isActive | ( | self | ) |
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.
Definition at line 514 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onBufferFull | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_FULL event to listeners.
data | cdrMemoryStream |
inline void onBufferFull(const cdrMemoryStream& data)
Definition at line 911 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onBufferRead | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_READ event to listeners.
data | cdrMemoryStream |
inline void onBufferRead(const cdrMemoryStream& data)
Definition at line 956 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onBufferWrite | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_WRITE event to listeners.
data | cdrMemoryStream |
inline void onBufferWrite(const cdrMemoryStream& data)
Definition at line 896 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onBufferWriteOverwrite | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_OVERWRITE event to listeners.
data | cdrMemoryStream |
inline void onBufferWriteOverwrite(const cdrMemoryStream& data)
Definition at line 941 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onBufferWriteTimeout | ( | self, | |
data | |||
) |
Notify an ON_BUFFER_WRITE_TIMEOUT event to listeners.
data | cdrMemoryStream |
inline void onBufferWriteTimeout(const cdrMemoryStream& data)
Definition at line 926 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onReceived | ( | self, | |
data | |||
) |
Notify an ON_RECEIVED event to listeners.
data | cdrMemoryStream |
inline void onReceived(const cdrMemoryStream& data)
Definition at line 986 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onReceiverError | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_ERROR event to listeners.
data | cdrMemoryStream |
inline void onReceiverError(const cdrMemoryStream& data)
Definition at line 1031 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onReceiverFull | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_FULL event to listeners.
data | cdrMemoryStream |
inline void onReceiverFull(const cdrMemoryStream& data)
Definition at line 1001 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onReceiverTimeout | ( | self, | |
data | |||
) |
Notify an ON_RECEIVER_TIMEOUT event to listeners.
data | cdrMemoryStream |
inline void onReceiverTimeout(const cdrMemoryStream& data)
Definition at line 1016 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onSend | ( | self, | |
data | |||
) |
Notify an ON_SEND event to listners.
data | cdrMemoryStream |
inline void onSend(const cdrMemoryStream& data)
Definition at line 971 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.onSenderError | ( | self | ) |
Notify an ON_SENDER_ERROR event to listeners.
data | cdrMemoryStream |
inline void onSenderError()
Definition at line 1046 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.pushAll | ( | self | ) |
push all policy
PublisherNew::ReturnCode PublisherNew::pushAll()
Definition at line 615 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.pushFifo | ( | self | ) |
push "fifo" policy
PublisherNew::ReturnCode PublisherNew::pushFifo()
Definition at line 644 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.pushNew | ( | self | ) |
push "new" policy
PublisherNew::ReturnCode PublisherNew::pushNew()
Definition at line 720 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.pushSkip | ( | self | ) |
push "skip" policy
PublisherNew::ReturnCode PublisherNew::pushSkip()
Definition at line 672 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.setBuffer | ( | self, | |
buffer | |||
) |
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.
buffer | A pointer to a CDR buffer object. |
PublisherBase::ReturnCode PublisherNew::setBuffer(CdrBufferBase* buffer)
Definition at line 324 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.setConsumer | ( | self, | |
consumer | |||
) |
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.
consumer | A pointer to a consumer object. |
PublisherBase::ReturnCode PublisherNew::setConsumer(InPortConsumer* consumer)
Definition at line 288 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.setListener | ( | self, | |
info, | |||
listeners | |||
) |
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.
info | ConnectorInfo that is localized object of ConnectorProfile |
listeners | ConnectorListeners that holds various listeners |
virtual ReturnCode setListener(ConnectorInfo& info, ConnectorListeners* listeners);
Definition at line 369 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.setPushPolicy | ( | self, | |
prop | |||
) |
Setting PushPolicyvoid PublisherNew::setPushPolicy(const coil::Properties& prop)
Definition at line 120 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.svc | ( | self | ) |
Thread execution function.
A task execution function to be executed by coil::PeriodicTask.
int PublisherNew::svc(void)
Definition at line 591 of file PublisherNew.py.
def OpenRTM_aist.PublisherNew.PublisherNew.write | ( | self, | |
data, | |||
sec, | |||
usec | |||
) |
Write data.
This function writes data into the buffer associated with this Publisher. If a Publisher object calls this function, without initializing correctly such as a consumer, a buffer, listeners, etc., error code PRECONDITION_NOT_MET will be returned and no operation of the writing to a buffer etc. will be performed.
Since writing into the buffer and sending data to InPort are performed asynchronously, occasionally this function returns return-codes such as CONNECTION_LOST and BUFFER_FULL that indicate the result of sending data to InPort. In this case, writing data into buffer will not be performed.
When publisher writes data to the buffer, if the buffer is filled, returns error, is returned with timeout and returns precondition error, error codes BUFFER_FULL, BUFFER_ERROR, BUFFER_TIMEOUT and PRECONDITION_NOT_MET will be returned respectively.
In other cases, PROT_ERROR will be returned.
data | Data to be wrote to the buffer |
sec | Timeout time in unit seconds |
nsec | Timeout time in unit nano-seconds |
PublisherBase::ReturnCode PublisherNew::write(const cdrMemoryStream& data, unsigned long sec, unsigned long usec)
Definition at line 459 of file PublisherNew.py.
|
private |
Definition at line 79 of file PublisherNew.py.
|
private |
Definition at line 73 of file PublisherNew.py.
|
private |
Definition at line 72 of file PublisherNew.py.
|
private |
Definition at line 80 of file PublisherNew.py.
|
private |
Definition at line 82 of file PublisherNew.py.
|
private |
Definition at line 81 of file PublisherNew.py.
|
private |
Definition at line 77 of file PublisherNew.py.
|
private |
Definition at line 75 of file PublisherNew.py.
|
private |
Definition at line 76 of file PublisherNew.py.
|
private |
Definition at line 71 of file PublisherNew.py.
|
private |
Definition at line 78 of file PublisherNew.py.
|
private |
Definition at line 74 of file PublisherNew.py.
|
static |
Definition at line 51 of file PublisherNew.py.
|
static |
Definition at line 52 of file PublisherNew.py.
|
static |
Definition at line 54 of file PublisherNew.py.
|
static |
Definition at line 53 of file PublisherNew.py.