OpenRTM-aist  1.2.1
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/Mutex.h>
23 #include <coil/Factory.h>
24 
25 #include <rtm/idl/SDOPackageStub.h>
26 #include <rtm/SystemLogger.h>
27 
28 namespace RTC
29 {
30  class RTObject_impl;
31  class SdoServiceProviderBase;
32  class SdoServiceConsumerBase;
33 
149  {
150  public:
171 
187  virtual ~SdoServiceAdmin();
188 
198  virtual void init(coil::Properties& prop);
199 
211  SDOPackage::ServiceProfileList* getServiceProviderProfiles();
212 
240  SDOPackage::ServiceProfile* getServiceProviderProfile(const char* id);
241 
269  SDOPackage::SDOService_ptr getServiceProvider(const char* id);
270 
278  bool addSdoServiceProvider(const SDOPackage::ServiceProfile& prof,
279  SdoServiceProviderBase* provider);
280 
288  bool removeSdoServiceProvider(const char* id);
289 
301  bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& sProfile);
302 
314  bool removeSdoServiceConsumer(const char* id);
315 
316 protected:
326  void initProvider(coil::Properties& prop);
336  void initConsumer(coil::Properties& prop);
348  bool isEnabledConsumerType(const SDOPackage::ServiceProfile& sProfile);
349 
361  bool isExistingConsumerType(const SDOPackage::ServiceProfile& sProfile);
362 
363  const std::string getUUID() const;
364 
365  std::string ifrToKey(std::string& ifr);
366 
367 
368  private:
369  RTC::RTObject_impl& m_rtobj;
370  coil::vstring m_consumerTypes;
371  bool m_allConsumerEnabled;
372 
380  std::vector<SdoServiceProviderBase*> m_providers;
381  coil::Mutex m_provider_mutex;
382 
390  std::vector<SdoServiceConsumerBase*> m_consumers;
391  coil::Mutex m_consumer_mutex;
392 
400  ::RTC::Logger rtclog;
401  };
402 
403 
404 };
405 
406 #endif // RTC_SDOSERVICEADMIN_H
void initConsumer(coil::Properties &prop)
Consumer Initialization.
RT-Component.
Definition: SdoServiceAdmin.h:148
Mutex class.
Definition: Mutex.h:40
RT component logger class.
virtual void init(coil::Properties &prop)
Initialization.
virtual ~SdoServiceAdmin()
Virtual destractor.
RT-Component class.
Definition: RTObject.h:89
bool removeSdoServiceProvider(const char *id)
Remove a SDO service provider.
SDOPackage::SDOService_ptr getServiceProvider(const char *id)
Get ServiceProfile of an SDO Service.
bool isEnabledConsumerType(const SDOPackage::ServiceProfile &sProfile)
If it is enabled service type.
void initProvider(coil::Properties &prop)
Provider Initialization.
std::vector< std::string > vstring
Definition: stringutil.h:45
SdoServiceAdmin(::RTC::RTObject_impl &rtobj)
Constructor.
Definition: SdoServiceProviderBase.h:134
SDOPackage::ServiceProfile * getServiceProviderProfile(const char *id)
Get ServiceProfile of an SDO Service Provider.
std::string ifrToKey(std::string &ifr)
Logger class.
Definition: SystemLogger.h:99
bool addSdoServiceProvider(const SDOPackage::ServiceProfile &prof, SdoServiceProviderBase *provider)
Set a SDO service provider.
Class represents a set of properties.
Definition: Properties.h:101
const std::string getUUID() const
bool addSdoServiceConsumer(const SDOPackage::ServiceProfile &sProfile)
Add Service Consumer.
SDOPackage::ServiceProfileList * getServiceProviderProfiles()
Get ServiceProfileList of SDO Service Provider.
bool isExistingConsumerType(const SDOPackage::ServiceProfile &sProfile)
If it is existing service type.
bool removeSdoServiceConsumer(const char *id)
Remove Service Consumer.