Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
RTC::OutPortProvider Class Reference

OutPortProvider. More...

#include <OutPortProvider.h>

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

List of all members.

Classes

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

Public Member Functions

virtual void init (coil::Properties &prop)
 Initializing configuration.
virtual bool publishInterface (SDOPackage::NVList &properties)
 Publish interface information.
virtual void publishInterfaceProfile (SDOPackage::NVList &properties)
 Publish InterfaceProfile information.
virtual void setBuffer (CdrBufferBase *buffer)=0
 Setting outside buffer's pointer.
virtual void setConnector (OutPortConnector *connector)=0
 set Connector
virtual void setListener (ConnectorInfo &info, ConnectorListeners *listeners)=0
 Set the listener.
virtual DATAPORTSTATUS_ENUM ~OutPortProvider (void)
 Destructor.

Protected Member Functions

void setDataFlowType (const char *dataflow_type)
 Set the data flow type.
void setDataType (const char *data_type)
 Set the data type.
void setInterfaceType (const char *interface_type)
 Set the interface type.
void setPortType (const char *port_type)
 Set the port 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.

Private Attributes

std::string m_dataflowType
std::string m_dataType
std::string m_interfaceType
std::string m_portType
std::string m_subscriptionType

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

Definition at line 189 of file OutPortProvider.h.


Constructor & Destructor Documentation

Destructor.

Virtual destructor

Definition at line 32 of file OutPortProvider.cpp.


Member Function Documentation

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 OutPortBase::OutPortCorbaCdrProviderMock, OutPortPullConnector::OutPortCorbaCdrProviderMock, OutPort::OutPortCorbaCdrProviderMock, and RTC::OutPortCorbaCdrProvider.

Definition at line 43 of file OutPortProvider.cpp.

bool RTC::OutPortProvider::publishInterface ( SDOPackage::NVList &  properties) [virtual]

Publish interface information.

Publish interface information. Check the dataport.interface_type value of the NameValue object specified by an argument in the property information, and add the information to the NameValue if this port is not specified. This does not do anything if the same interface is already subscribed.

Parameters:
propertiesProperties to receive interface information
Returns:
true: normal return

Reimplemented in OutPortBase::OutPortCorbaCdrProviderMock.

Definition at line 74 of file OutPortProvider.cpp.

void RTC::OutPortProvider::publishInterfaceProfile ( SDOPackage::NVList &  properties) [virtual]

Publish InterfaceProfile information.

Publish interfaceProfile information. Check the dataport.interface_type value of the NameValue object specified by an argument in property information and get information only when the interface type of the specified port is matched.

Parameters:
propertiesProperties to get InterfaceProfile information

Reimplemented in OutPortBase::OutPortCorbaCdrProviderMock, OutPortPullConnector::OutPortCorbaCdrProviderMock, and OutPort::OutPortCorbaCdrProviderMock.

Definition at line 54 of file OutPortProvider.cpp.

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

Setting outside buffer's pointer.

A pointer to a buffer from which OutPortProvider retrieve data. If already buffer is set, previous buffer's pointer will be overwritten by the given pointer to a buffer. Since OutPortProvider does not assume ownership of the buffer pointer, destructor of the buffer should be done by user.

Parameters:
bufferA pointer to a data buffer to be used by OutPortProvider

Implemented in OutPortBase::OutPortCorbaCdrProviderMock, OutPortPullConnector::OutPortCorbaCdrProviderMock, OutPortProvider::OutPortProviderMock, and RTC::OutPortCorbaCdrProvider.

Definition at line 1035 of file OutPortTests.cpp.

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

set Connector

OutPort creates OutPortConnector object when it establishes connection between OutPort and InPort, and it calls this function with a pointer to the connector object. Since the OutPort has the ownership of this connector, OutPortProvider should not delete it.

Parameters:
connectorOutPortConnector

Implemented in OutPortBase::OutPortCorbaCdrProviderMock, OutPortPullConnector::OutPortCorbaCdrProviderMock, RTC::OutPortCorbaCdrProvider, and OutPortProvider::OutPortProviderMock.

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

Set the data flow type.

Set the data flow type specified by the argument.

Parameters:
dataflow_typeThe target data flow type to set

Definition at line 130 of file OutPortProvider.cpp.

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

Set the data type.

Set the data type specified by the argument.

Parameters:
data_typeThe target data type to set

Definition at line 106 of file OutPortProvider.cpp.

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

Set the interface type.

Set theinterface type specified by the argument.

Parameters:
interface_typeThe target interface type to set

Definition at line 118 of file OutPortProvider.cpp.

virtual void RTC::OutPortProvider::setListener ( ConnectorInfo info,
ConnectorListeners listeners 
) [pure virtual]

Set the listener.

OutPort provides callback functionality that calls specific listener objects according to the events in the data publishing process. For details, see documentation of ConnectorDataListener class and ConnectorListener class in ConnectorListener.h. In the sub-classes of OutPortProvider, the given listeners should be called in the proper timing. However, it is not necessary to call all the listeners.

Parameters:
infoConnector information
listenersListener objects

Implemented in OutPortBase::OutPortCorbaCdrProviderMock, OutPortPullConnector::OutPortCorbaCdrProviderMock, RTC::OutPortCorbaCdrProvider, and OutPortProvider::OutPortProviderMock.

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

Set the port type.

Set the port type specified by the argument.

Parameters:
port_typeThe target port type to set

Definition at line 94 of file OutPortProvider.cpp.

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

Set the subscription type.

Set the subscription type specified by the argument.

Parameters:
subs_typeThe target subscription type to set

Definition at line 142 of file OutPortProvider.cpp.


Member Data Documentation

std::string RTC::OutPortProvider::m_dataflowType [private]

Definition at line 496 of file OutPortProvider.h.

std::string RTC::OutPortProvider::m_dataType [private]

Definition at line 494 of file OutPortProvider.h.

Definition at line 495 of file OutPortProvider.h.

std::string RTC::OutPortProvider::m_portType [private]

Definition at line 493 of file OutPortProvider.h.

SDOPackage::NVList RTC::OutPortProvider::m_properties [protected]

Properties to hold the port profiles.

Definition at line 482 of file OutPortProvider.h.

Definition at line 497 of file OutPortProvider.h.

Logger RTC::OutPortProvider::rtclog [mutable, protected]

Logger stream.

Definition at line 490 of file OutPortProvider.h.


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


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:14