OpenRTM-aist 2.1.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTC::OutPortProvider Class Referenceabstract

OutPortProvider. More...

#include <OutPortProvider.h>

Inheritance diagram for RTC::OutPortProvider:
Inheritance graph
[legend]
Collaboration diagram for RTC::OutPortProvider:
Collaboration graph
[legend]

Classes

struct  publishInterfaceFunc
 Functor to publish interface profile . More...
 
struct  publishInterfaceProfileFunc
 Functor to publish interface profile . More...
 

Public Member Functions

virtual ~OutPortProvider ()
 Destructor.
 
virtual void init (coil::Properties &prop)
 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 void setConnector (OutPortConnector *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 setPortType (const char *port_type)
 Set the port type.
 
void setDataType (const char *data_type)
 Set the data type.
 
void setInterfaceType (const char *interface_type)
 Set the interface type.
 
void setDataFlowType (const char *dataflow_type)
 Set the data flow type.
 
void setSubscriptionType (const char *subs_type)
 Set the subscription type.
 

Protected Attributes

SDOPackage::NVList m_properties
 Properties to hold the port profiles .
 
Logger rtclog
 Logger stream .
 

Detailed Description

OutPortProvider.

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.

Moreover, calling the following functions in the constructor, and properties have to be set.

OutPortProvider'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.

OutPort inquires available OutPortProviders to the factory class of OutPortProvider, and publishes available interfaces to others. Therefore, sub-classes of OutPortProvider that provides PROVIDED interface to OutPort should register its factory to OutPortProviderFactory.

RTC::OutPortProviderFactory::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 OutPortCorbaCdrProviderInit(void)
  {
    RTC::OutPortProviderFactory&
                        factory(RTC::OutPortProviderFactory::instance());
    factory.addFactory("corba_cdr",
                       ::coil::Creator<RTC::OutPortProvider,
                                       RTC::OutPortCorbaCdrProvider>,
                       ::coil::Destructor<RTC::OutPortProvider,
                                          RTC::OutPortCorbaCdrProvider>);
  }
};

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 OutPortProviders are compiled as a shared object or DLL for dynamic loading, new OutPortProvider types can be added dynamically.

Since
0.4.0

Constructor & Destructor Documentation

◆ ~OutPortProvider()

virtual RTC::OutPortProvider::~OutPortProvider ( )
virtual

Destructor.

Member Function Documentation

◆ init()

virtual void RTC::OutPortProvider::init ( coil::Properties &  prop)
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.

Parameters
propConfiguration information

Reimplemented in RTC::OutPortCorbaCdrProvider, RTC::OutPortDirectProvider, RTC::OutPortDSProvider, and RTC::OutPortSHMProvider.

◆ publishInterface()

virtual bool RTC::OutPortProvider::publishInterface ( SDOPackage::NVList &  prop)
virtual

Publish interface information.

Referenced by RTC::OutPortProvider::publishInterfaceFunc::operator()().

◆ publishInterfaceProfile()

virtual void RTC::OutPortProvider::publishInterfaceProfile ( SDOPackage::NVList &  prop)
virtual

Publish InterfaceProfile information.

Referenced by RTC::OutPortProvider::publishInterfaceProfileFunc::operator()().

◆ setBuffer()

virtual void RTC::OutPortProvider::setBuffer ( CdrBufferBase buffer)
pure virtual

◆ setConnector()

virtual void RTC::OutPortProvider::setConnector ( OutPortConnector connector)
pure virtual

◆ setDataFlowType()

void RTC::OutPortProvider::setDataFlowType ( const char *  dataflow_type)
protected

Set the data flow type.

◆ setDataType()

void RTC::OutPortProvider::setDataType ( const char *  data_type)
protected

Set the data type.

◆ setInterfaceType()

void RTC::OutPortProvider::setInterfaceType ( const char *  interface_type)
protected

Set the interface type.

◆ setListener()

virtual void RTC::OutPortProvider::setListener ( ConnectorInfo info,
ConnectorListenersBase listeners 
)
pure virtual

◆ setPortType()

void RTC::OutPortProvider::setPortType ( const char *  port_type)
protected

Set the port type.

◆ setSubscriptionType()

void RTC::OutPortProvider::setSubscriptionType ( const char *  subs_type)
protected

Set the subscription type.

Member Data Documentation

◆ m_properties

SDOPackage::NVList RTC::OutPortProvider::m_properties
protected

Properties to hold the port profiles .

◆ rtclog

Logger RTC::OutPortProvider::rtclog
mutableprotected

Logger stream .


The documentation for this class was generated from the following file: