OpenRTM-aist  2.1.0
SdoServiceAdmin.h
Go to the documentation of this file.
1 // -*- C++ -*-
19 #ifndef RTC_SDOSERVICEADMIN_H
20 #define RTC_SDOSERVICEADMIN_H
21 
22 #include <coil/Factory.h>
23 
24 #include <rtm/idl/SDOPackageStub.h>
25 #include <rtm/SystemLogger.h>
26 
27 #include <string>
28 #include <vector>
29 
30 namespace RTC
31 {
32  class RTObject_impl;
33  class SdoServiceProviderBase;
34  class SdoServiceConsumerBase;
35 
151  {
152  public:
173 
189  virtual ~SdoServiceAdmin();
190 
200  virtual void init(const coil::Properties& prop);
201 
213  SDOPackage::ServiceProfileList* getServiceProviderProfiles();
214 
242  SDOPackage::ServiceProfile* getServiceProviderProfile(const char* id);
243 
271  SDOPackage::SDOService_ptr getServiceProvider(const char* id);
272 
280  bool addSdoServiceProvider(const SDOPackage::ServiceProfile& prof,
281  SdoServiceProviderBase* provider);
282 
290  bool removeSdoServiceProvider(const char* id);
291 
303  bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& sProfile);
304 
316  bool removeSdoServiceConsumer(const char* id);
317 
318 protected:
328  void initProvider(const coil::Properties& prop);
338  void initConsumer(const coil::Properties& prop);
339 
340 
352  bool isEnabledConsumerType(const SDOPackage::ServiceProfile& sProfile);
353 
365  bool isExistingConsumerType(const SDOPackage::ServiceProfile& sProfile);
366 
367  static std::string getUUID() ;
368 
369  static std::string ifrToKey(std::string& ifr);
370 
371 
372  private:
373  RTC::RTObject_impl& m_rtobj;
374  coil::vstring m_consumerTypes;
375  bool m_allConsumerEnabled;
376 
384  std::vector<SdoServiceProviderBase*> m_providers;
385  std::mutex m_provider_mutex;
386 
394  std::vector<SdoServiceConsumerBase*> m_consumers;
395  std::mutex m_consumer_mutex;
396 
404  ::RTC::Logger rtclog;
405  };
406 
407 
408 } // namespace RTC
409 
410 #endif // RTC_SDOSERVICEADMIN_H
RT component logger class.
Logger class.
Definition: SystemLogger.h:101
RT-Component class.
Definition: RTObject.h:93
Definition: SdoServiceAdmin.h:151
virtual void init(const coil::Properties &prop)
Initialization.
bool isExistingConsumerType(const SDOPackage::ServiceProfile &sProfile)
If it is existing service type.
static std::string getUUID()
static std::string ifrToKey(std::string &ifr)
SdoServiceAdmin(::RTC::RTObject_impl &rtobj)
Constructor.
bool addSdoServiceConsumer(const SDOPackage::ServiceProfile &sProfile)
Add Service Consumer.
bool removeSdoServiceProvider(const char *id)
Remove a SDO service provider.
bool removeSdoServiceConsumer(const char *id)
Remove Service Consumer.
void initConsumer(const coil::Properties &prop)
Consumer Initialization.
SDOPackage::ServiceProfileList * getServiceProviderProfiles()
Get ServiceProfileList of SDO Service Provider.
bool isEnabledConsumerType(const SDOPackage::ServiceProfile &sProfile)
If it is enabled service type.
void initProvider(const coil::Properties &prop)
Provider Initialization.
virtual ~SdoServiceAdmin()
Virtual destractor.
SDOPackage::ServiceProfile * getServiceProviderProfile(const char *id)
Get ServiceProfile of an SDO Service Provider.
SDOPackage::SDOService_ptr getServiceProvider(const char *id)
Get ServiceProfile of an SDO Service.
bool addSdoServiceProvider(const SDOPackage::ServiceProfile &prof, SdoServiceProviderBase *provider)
Set a SDO service provider.
Definition: SdoServiceProviderBase.h:136
RT-Component.
coil::Properties Properties
Definition: RTC.h:72