Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
RTC::InPortProvider Class Referenceabstract

InPortProvider. More...

#include <InPortProvider.h>

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

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)=0
 Initializing configuration. More...
 
DATAPORTSTATUS_ENUM InPortProvider ()
 Constructor. More...
 
virtual bool publishInterface (SDOPackage::NVList &properties)
 Publish interface information. More...
 
virtual void publishInterfaceProfile (SDOPackage::NVList &properties)
 Publish InterfaceProfile information. More...
 
virtual void setBuffer (BufferBase< cdrMemoryStream > *buffer)=0
 Setting outside buffer's pointer. More...
 
virtual void setConnector (InPortConnector *connector)=0
 set Connector More...
 
virtual void setListener (ConnectorInfo &info, ConnectorListeners *listeners)=0
 Set the listener. More...
 
virtual ~InPortProvider (void)
 Destructor. More...
 

Protected Member Functions

void setDataFlowType (const char *dataflow_type)
 Set the dataflow type. More...
 
void setInterfaceType (const char *interface_type)
 Set the interface type. More...
 
void setSubscriptionType (const char *subs_type)
 Set the subscription type. More...
 

Protected Attributes

SDOPackage::NVList m_properties
 Properties to hold port profile. More...
 
Logger rtclog
 Logger stream. More...
 

Private Attributes

std::string m_dataflowType
 
std::string m_interfaceType
 
std::string m_subscriptionType
 

Additional Inherited Members

- Public Types inherited from RTC::DataPortStatus
enum  Enum {
  PORT_OK = 0, PORT_ERROR, BUFFER_ERROR, BUFFER_FULL,
  BUFFER_EMPTY, BUFFER_TIMEOUT, SEND_FULL, SEND_TIMEOUT,
  RECV_EMPTY, RECV_TIMEOUT, INVALID_ARGS, PRECONDITION_NOT_MET,
  CONNECTION_LOST, UNKNOWN_ERROR
}
 DataPortStatus return codes. More...
 
- Static Public Member Functions inherited from RTC::DataPortStatus
static const char * toString (DataPortStatus::Enum status)
 Convert DataPortStatus into the string. More...
 

Detailed Description

InPortProvider.

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.

Since
0.4.0

Definition at line 190 of file InPortProvider.h.

Constructor & Destructor Documentation

◆ InPortProvider()

RTC::InPortProvider::InPortProvider ( )

Constructor.

Destructor.

Constructor

Definition at line 32 of file InPortProvider.cpp.

◆ ~InPortProvider()

RTC::InPortProvider::~InPortProvider ( void  )
virtual

Destructor.

Virtual destructor

Definition at line 44 of file InPortProvider.cpp.

Member Function Documentation

◆ init()

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

Parameters
propConfiguration information

Implemented in InPortBase::InPortCorbaCdrProviderMock, InPortPushConnector::InPortCorbaCdrProviderMock, InPort::InPortCorbaCdrProviderMock, RTC::InPortCorbaCdrProvider, and InPortProvider::InPortProviderMock.

◆ publishInterface()

bool RTC::InPortProvider::publishInterface ( SDOPackage::NVList &  properties)
virtual

Publish interface information.

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

Definition at line 76 of file InPortProvider.cpp.

◆ publishInterfaceProfile()

void RTC::InPortProvider::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 InPortBase::InPortCorbaCdrProviderMock, InPortPushConnector::InPortCorbaCdrProviderMock, and InPort::InPortCorbaCdrProviderMock.

Definition at line 55 of file InPortProvider.cpp.

◆ setBuffer()

virtual void RTC::InPortProvider::setBuffer ( BufferBase< cdrMemoryStream > *  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 InPortBase::InPortCorbaCdrProviderMock, InPortPushConnector::InPortCorbaCdrProviderMock, InPort::InPortCorbaCdrProviderMock, RTC::InPortCorbaCdrProvider, and InPortProvider::InPortProviderMock.

◆ setConnector()

virtual void RTC::InPortProvider::setConnector ( InPortConnector 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 InPortBase::InPortCorbaCdrProviderMock, InPortPushConnector::InPortCorbaCdrProviderMock, InPort::InPortCorbaCdrProviderMock, RTC::InPortCorbaCdrProvider, and InPortProvider::InPortProviderMock.

◆ setDataFlowType()

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

Set the dataflow type.

Set the dataflow type.

Parameters
dataflow_typeThe target data flow type for set

Definition at line 115 of file InPortProvider.cpp.

◆ setInterfaceType()

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

Set the interface type.

Set the interface type.

Parameters
interface_typeThe target interface type for set

Definition at line 102 of file InPortProvider.cpp.

◆ setListener()

virtual void RTC::InPortProvider::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 InPortBase::InPortCorbaCdrProviderMock, InPortPushConnector::InPortCorbaCdrProviderMock, InPort::InPortCorbaCdrProviderMock, RTC::InPortCorbaCdrProvider, and InPortProvider::InPortProviderMock.

◆ setSubscriptionType()

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

Set the subscription type.

Set the subscription type.

Parameters
subs_typeThe target subscription type for set

Definition at line 128 of file InPortProvider.cpp.

Member Data Documentation

◆ m_dataflowType

std::string RTC::InPortProvider::m_dataflowType
private

Definition at line 474 of file InPortProvider.h.

◆ m_interfaceType

std::string RTC::InPortProvider::m_interfaceType
private

Definition at line 473 of file InPortProvider.h.

◆ m_properties

SDOPackage::NVList RTC::InPortProvider::m_properties
protected

Properties to hold port profile.

Definition at line 461 of file InPortProvider.h.

◆ m_subscriptionType

std::string RTC::InPortProvider::m_subscriptionType
private

Definition at line 475 of file InPortProvider.h.

◆ rtclog

Logger RTC::InPortProvider::rtclog
mutableprotected

Logger stream.

Definition at line 470 of file InPortProvider.h.


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


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:47