OpenRTM  1.0.0
SdoServiceAdmin.h
説明を見る。
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 
200  SDOPackage::ServiceProfileList* getServiceProviderProfiles();
201 
229  SDOPackage::ServiceProfile* getServiceProviderProfile(const char* id);
230 
258  SDOPackage::SDOService_ptr getServiceProvider(const char* id);
259 
267  bool addSdoServiceProvider(const SDOPackage::ServiceProfile& prof,
268  SdoServiceProviderBase* provider);
269 
277  bool removeSdoServiceProvider(const char* id);
278 
290  bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& sProfile);
291 
303  bool removeSdoServiceConsumer(const char* id);
304 
305 protected:
317  bool isEnabledConsumerType(const SDOPackage::ServiceProfile& sProfile);
318 
330  bool isExistingConsumerType(const SDOPackage::ServiceProfile& sProfile);
331 
332  const std::string getUUID() const;
333 
334  std::string ifrToKey(std::string& ifr);
335 
336 
337  private:
338  RTC::RTObject_impl& m_rtobj;
339  coil::vstring m_consumerTypes;
340  bool m_allConsumerEnabled;
341 
349  std::vector<SdoServiceProviderBase*> m_providers;
350  coil::Mutex m_provider_mutex;
351 
359  std::vector<SdoServiceConsumerBase*> m_consumers;
360  coil::Mutex m_consumer_mutex;
361 
369  ::RTC::Logger rtclog;
370  };
371 
372 
373 };
374 
375 #endif // RTC_SDOSERVICEADMIN_H