OpenRTM-aist 2.1.0
|
#include <InPortProvider.h>
Classes | |
struct | publishInterfaceFunc |
Functor to publish interface profile . More... | |
struct | publishInterfaceProfileFunc |
Functor to publish interface profile . More... | |
Public Member Functions | |
InPortProvider () | |
Constructor. | |
virtual | ~InPortProvider () |
Destructor. | |
virtual void | init (coil::Properties &prop)=0 |
Initializing configuration. | |
virtual void | setBuffer (BufferBase< ByteData > *buffer)=0 |
Setting outside buffer's pointer. | |
virtual void | setListener (ConnectorInfo &info, ConnectorListenersBase *listeners)=0 |
Set the listener. | |
virtual void | setConnector (InPortConnector *connector)=0 |
set Connector | |
virtual void | publishInterfaceProfile (SDOPackage::NVList &prop) |
Publish InterfaceProfile information. | |
virtual bool | publishInterface (SDOPackage::NVList &prop) |
Publish interface information. | |
Protected Member Functions | |
void | setInterfaceType (const char *interface_type) |
Set the interface type. | |
void | setDataFlowType (const char *dataflow_type) |
Set the dataflow type. | |
void | setSubscriptionType (const char *subs_type) |
Set the subscription type. | |
Protected Attributes | |
SDOPackage::NVList | m_properties |
Properties to hold port profile . | |
Logger | rtclog |
Logger stream . | |
The virtual class for InPort's PROVIDED interface implementation. New interface for InPort have to inherit this class, and have to implement the following functions.
Moreover, calling the following functions in the constructor, and properties have to be set.
InPortProvider's properties that have to be provided to others should be set to protected variable (SDOPackage::NVList) m_properties. Values that are set to the property are published as interface profile information, and it is also published to required interface when connection is established. The following virtual functions are called when port's profiles are acquired from others or connections are established. The following virtual functions are called when port's profiles are acquired from others or connections are established. Interface profile information that is reviously set is given to Port calling by these functions.
InPort inquires available InPortProviders to the factory class of InPortProvider, and publishes available interfaces to others. Therefore, sub-classes of InPortProvider that provides PROVIDED interface to InPort should register its factory to InPortProviderFactory.
RTC::InPortProviderFactory::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 InPortCorbaCdrProviderInit(void) { RTC::InPortProviderFactory& factory(RTC::InPortProviderFactory::instance()); factory.addFactory("corba_cdr", ::coil::Creator<RTC::InPortProvider, RTC::InPortCorbaCdrProvider>, ::coil::Destructor<RTC::InPortProvider, RTC::InPortCorbaCdrProvider>); } };
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 InPortProviders are compiled as a shared object or DLL for dynamic loading, new InPortProvider types can be added dynamically.
RTC::InPortProvider::InPortProvider | ( | ) |
Constructor.
|
virtual |
Destructor.
|
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::InPortCorbaCdrProvider, RTC::InPortCorbaCdrUDPProvider, RTC::InPortDirectProvider, RTC::InPortDSProvider, and RTC::InPortSHMProvider.
|
virtual |
Publish interface information.
Referenced by RTC::InPortProvider::publishInterfaceFunc::operator()().
|
virtual |
Publish InterfaceProfile information.
Referenced by RTC::InPortProvider::publishInterfaceProfileFunc::operator()().
|
pure virtual |
Setting outside buffer's pointer.
Implemented in RTC::InPortCorbaCdrProvider, RTC::InPortCorbaCdrUDPProvider, RTC::InPortDirectProvider, RTC::InPortDSProvider, and RTC::InPortSHMProvider.
|
pure virtual |
set Connector
Implemented in RTC::InPortCorbaCdrProvider, RTC::InPortCorbaCdrUDPProvider, RTC::InPortDirectProvider, RTC::InPortDSProvider, and RTC::InPortSHMProvider.
|
protected |
Set the dataflow type.
|
protected |
Set the interface type.
|
pure virtual |
Set the listener.
Implemented in RTC::InPortCorbaCdrProvider, RTC::InPortCorbaCdrUDPProvider, RTC::InPortDirectProvider, RTC::InPortDSProvider, and RTC::InPortSHMProvider.
|
protected |
Set the subscription type.
|
protected |
Properties to hold port profile .