OpenRTM-aist 2.1.0
|
OutPortConsumer abstract class. More...
#include <OutPortConsumer.h>
Classes | |
struct | subscribe |
Functor to subscribe the interface . More... | |
struct | unsubscribe |
Functor to unsubscribe the interface . More... | |
Public Member Functions | |
virtual | ~OutPortConsumer ()=default |
Destructor. | |
virtual void | init (coil::Properties &prop)=0 |
Initializing configuration. | |
virtual void | setBuffer (CdrBufferBase *buffer)=0 |
Setting outside buffer's pointer. | |
virtual void | setListener (ConnectorInfo &info, ConnectorListenersBase *listeners)=0 |
Set the listener. | |
virtual DataPortStatus | get (ByteData &data)=0 |
Receive data. | |
virtual bool | subscribeInterface (const SDOPackage::NVList &properties)=0 |
Subscribe the data receive notification. | |
virtual void | unsubscribeInterface (const SDOPackage::NVList &properties)=0 |
Unsubscribe the data receive notification. | |
OutPortConsumer abstract class.
The virtual class for OutPort's PROVIDED interface implementation. New interface for OutPort have to inherit this class, and have to implement the following functions.
Furthermore, connecting or disconnecting processes, such as obtaining some information from ConnectorProfile or releasing some resources, should be implemented in the following virtual functions.
InPort inquires available OutPortConsumers to the factory class of OutPortConsumer, and publishes available interfaces to others. Therefore, sub-classes of OutPortConsumer that provides PROVIDED interface to OutPort should register its factory to OutPortConsumerFactory.
RTC::OutPortConsumerFactory::instance().addFactory() would be called with the following arguments.
1st arg: The name of provider. ex. "corba_cdr" 2nd arg: Factory function. coil::Creator<B, T> 3rd arg: Destruction function. coil::Destructor<B, T>
The following example shows how to register factory function. And it is also declared as a initialization function.
extern "C" { void OutPortCorbaCdrConsumerInit(void) { RTC::OutPortConsumerFactory& factory(RTC::OutPortConsumerFactory::instance()); factory.addFactory("corba_cdr", ::coil::Creator<RTC::OutPortConsumer, RTC::OutPortCorbaCdrConsumer>, ::coil::Destructor<RTC::OutPortConsumer, RTC::OutPortCorbaCdrConsumer>); } };
It is recommended that the registration process is declared as a initialization function with "extern C" to be accessed from the outside of module. If the OutPortConsumers are compiled as a shared object or DLL for dynamic loading, new OutPortConsumer types can be added dynamically.
|
virtualdefault |
Destructor.
|
pure virtual |
Receive data.
Pure virtual function to receive data.
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
|
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.
prop | Configuration information |
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
|
pure virtual |
Setting outside buffer's pointer.
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
|
pure virtual |
Set the listener.
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
|
pure virtual |
Subscribe the data receive notification.
Pure virtual function to subscribe the data receive notification based on specified property information.
properties | Properties for subscription |
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
Referenced by RTC::OutPortConsumer::subscribe::operator()().
|
pure virtual |
Unsubscribe the data receive notification.
Pure virtual function to unsubscribe the data receive notification.
properties | Properties for unsubscription |
Implemented in RTC::OutPortCorbaCdrConsumer, RTC::OutPortDirectConsumer, RTC::OutPortDSConsumer, and RTC::OutPortSHMConsumer.
Referenced by RTC::OutPortConsumer::unsubscribe::operator()().