InPortBase.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef RTC_INPORTBASE_H
21 #define RTC_INPORTBASE_H
22 
23 #include <rtm/PortBase.h>
24 #include <rtm/DataPortStatus.h>
25 #include <rtm/CdrBufferBase.h>
26 #include <rtm/ConnectorListener.h>
27 
42 namespace RTC
43 {
44  class InPortProvider;
45  class OutPortConsumer;
46  class InPortConnector;
47 
67  class InPortBase
68  : public PortBase, public DataPortStatus
69  {
70  public:
72 
73  typedef std::vector<InPortConnector*> ConnectorList;
74 
94  InPortBase(const char* name, const char* data_type);
95 
109  virtual ~InPortBase(void);
110 
126  void init(coil::Properties& prop);
127 
142  virtual bool read() = 0;
143 
160 
179  const std::vector<InPortConnector*>& connectors();
180 
200 
220 
240 
261  InPortConnector* getConnectorById(const char* id);
262 
283  InPortConnector* getConnectorByName(const char* name);
284 
307  bool getConnectorProfileById(const char* id,
308  ConnectorInfo& prof);
309 
332  bool getConnectorProfileByName(const char* name,
333  ConnectorInfo& prof);
334 
335 
352  virtual void activateInterfaces();
353 
370  virtual void deactivateInterfaces();
371 
448  ConnectorDataListener* listener,
449  bool autoclean = true);
450 
451 
472  ConnectorDataListener* listener);
473 
474 
527  void addConnectorListener(ConnectorListenerType callback_type,
528  ConnectorListener* listener,
529  bool autoclean = true);
530 
551  ConnectorListener* listener);
552 
570  bool isLittleEndian();
571 
597  virtual ReturnCode_t
598  connect(ConnectorProfile& connector_profile)
599  throw (CORBA::SystemException);
600 
601  protected:
602 
631  virtual ReturnCode_t
632  publishInterfaces(ConnectorProfile& connector_profile);
633 
661  virtual ReturnCode_t
662  subscribeInterfaces(const ConnectorProfile& connector_profile);
663 
685  virtual void
686  unsubscribeInterfaces(const ConnectorProfile& connector_profile);
687 
688 
696  void initProviders();
697 
705  void initConsumers();
706 
738  bool checkEndian(const coil::Properties& prop, bool& littleEndian);
739 
752  createProvider(ConnectorProfile& cprof, coil::Properties& prop);
753 
766  createConsumer(const ConnectorProfile& cprof, coil::Properties& prop);
767 
780  createConnector(ConnectorProfile& cprof, coil::Properties& prop,
794  createConnector(const ConnectorProfile& cprof, coil::Properties& prop,
795  OutPortConsumer* consumer);
796 
797  protected:
853  ConnectorList m_connectors;
862 
871  };
872 }; // namespace RTC
873 
874 #endif // RTC_INPORTBASE_H
RTC&#39;s Port base class.
ConnectorListeners class.
bool checkEndian(const coil::Properties &prop, bool &littleEndian)
Checking endian flag of serializer.
Definition: InPortBase.cpp:763
virtual ReturnCode_t subscribeInterfaces(const ConnectorProfile &connector_profile)
Subscribe to the interface.
Definition: InPortBase.cpp:541
coil::Properties & properties()
Get properties.
Definition: InPortBase.cpp:134
#define DATAPORTSTATUS_ENUM
Importing RTC::DataPortStatus macro.
virtual void unsubscribeInterfaces(const ConnectorProfile &connector_profile)
Disconnect the interface connection.
Definition: InPortBase.cpp:630
DataPortStatus class.
CdrBufferBase * m_thebuffer
Buffer.
Definition: InPortBase.h:821
RT-Component.
virtual ReturnCode_t connect(ConnectorProfile &connector_profile)
[CORBA interface] Connect the Port
Definition: InPortBase.cpp:433
ConnectorDataListener class.
ReturnCode_t
Definition: doil.h:53
ConnectorListeners m_listeners
ConnectorDataListener listener.
Definition: InPortBase.h:870
std::vector< ConnectorInfo > ConnectorInfoList
bool isLittleEndian()
return it whether endian setting.
Definition: InPortBase.cpp:421
virtual void deactivateInterfaces()
Deactivate all Port interfaces.
Definition: InPortBase.cpp:322
coil::vstring m_providerTypes
Available providers.
Definition: InPortBase.h:837
coil::vstring m_consumerTypes
Available consumers.
Definition: InPortBase.h:845
virtual void activateInterfaces()
Activate all Port interfaces.
Definition: InPortBase.cpp:302
virtual ~InPortBase(void)
Destructor.
Definition: InPortBase.cpp:64
std::vector< std::string > vstring
Definition: stringutil.h:37
ConnectorDataListenerType
The types of ConnectorDataListener.
InPortConnector * createConnector(ConnectorProfile &cprof, coil::Properties &prop, InPortProvider *provider)
InPortPushConnector creation.
Definition: InPortBase.cpp:902
bool m_littleEndian
Connected Endian.
Definition: InPortBase.h:861
InPortConnector * getConnectorByName(const char *name)
Getting Connector by name.
Definition: InPortBase.cpp:238
DATAPORTSTATUS_ENUM typedef std::vector< InPortConnector * > ConnectorList
Definition: InPortBase.h:73
void removeConnectorDataListener(ConnectorDataListenerType listener_type, ConnectorDataListener *listener)
Removing BufferDataListener type listener.
Definition: InPortBase.cpp:363
InPortBase(const char *name, const char *data_type)
Constructor.
Definition: InPortBase.cpp:42
bool getConnectorProfileById(const char *id, ConnectorInfo &prof)
Getting ConnectorProfile by name.
Definition: InPortBase.cpp:261
ConnectorInfoList getConnectorProfiles()
ConnectorProfile list.
Definition: InPortBase.cpp:161
void initProviders()
InPort provider initialization.
Definition: InPortBase.cpp:665
coil::vstring getConnectorIds()
ConnectorId list.
Definition: InPortBase.cpp:179
bool getConnectorProfileByName(const char *name, ConnectorInfo &prof)
Getting ConnectorProfile by name.
Definition: InPortBase.cpp:281
void addConnectorListener(ConnectorListenerType callback_type, ConnectorListener *listener, bool autoclean=true)
Adding ConnectorListener type listener.
Definition: InPortBase.cpp:386
const std::vector< InPortConnector * > & connectors()
Connector list.
Definition: InPortBase.cpp:148
prop
Organization::get_organization_property ();.
void initConsumers()
OutPort consumer initialization.
Definition: InPortBase.cpp:714
ConnectorListenerType
The types of ConnectorListener.
Class represents a set of properties.
Definition: Properties.h:101
void removeConnectorListener(ConnectorListenerType callback_type, ConnectorListener *listener)
Removing BufferDataListener type listener.
Definition: InPortBase.cpp:401
coil::Properties m_properties
Properties.
Definition: InPortBase.h:829
OutPortConsumer abstract class.
coil::vstring getConnectorNames()
Connector name list.
Definition: InPortBase.cpp:197
InPortConnector * getConnectorById(const char *id)
Getting ConnectorProfile by ID.
Definition: InPortBase.cpp:215
void init(coil::Properties &prop)
Initializing properties.
Definition: InPortBase.cpp:96
bool m_singlebuffer
Buffer mode.
Definition: InPortBase.h:813
OutPortConsumer * createConsumer(const ConnectorProfile &cprof, coil::Properties &prop)
InPort provider creation.
Definition: InPortBase.cpp:857
DataPortStatus mixin class.
BufferBase abstract class.
Definition: BufferBase.h:104
virtual bool read()=0
It is a virtual method that is called from RTObject_impl::readAll(). This method reads out data from ...
connector listener class
void addConnectorDataListener(ConnectorDataListenerType listener_type, ConnectorDataListener *listener, bool autoclean=true)
Adding BufferDataListener type listener.
Definition: InPortBase.cpp:347
ConnectorList m_connectors
Connection list.
Definition: InPortBase.h:853
InPortProvider * createProvider(ConnectorProfile &cprof, coil::Properties &prop)
InPort provider creation.
Definition: InPortBase.cpp:803
virtual ReturnCode_t publishInterfaces(ConnectorProfile &connector_profile)
Publish interface information.
Definition: InPortBase.cpp:462


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:58