00001 
00019 #ifndef RTC_SDOSERVICEADMIN_H
00020 #define RTC_SDOSERVICEADMIN_H
00021 
00022 #include <coil/Mutex.h>
00023 #include <coil/Factory.h>
00024 
00025 #include <rtm/idl/SDOPackageStub.h>
00026 #include <rtm/SystemLogger.h>
00027 
00028 namespace RTC
00029 {
00030   class RTObject_impl;
00031   class SdoServiceConsumerBase;
00032 
00103   class SdoServiceAdmin
00104   {
00105   public:
00125     SdoServiceAdmin(::RTC::RTObject_impl& rtobj);
00126 
00142     virtual ~SdoServiceAdmin();
00143     
00155     bool addSdoServiceConsumerFactory();
00156 
00168     bool removeSdoServiceConsumerFactory();
00169     
00181     bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& sProfile);
00182     
00194     bool removeSdoServiceConsumer(const char* id);
00195     
00196 protected:
00208     bool isAllowedConsumerType(const SDOPackage::ServiceProfile& sProfile);
00209 
00221     bool isExistingConsumerType(const SDOPackage::ServiceProfile& sProfile);
00222 
00223     const std::string getUUID() const;
00224     
00225 
00226   private:
00227     RTC::RTObject_impl& m_rtobj;
00228     coil::vstring m_consumerTypes;
00229     bool m_allConsumerAllowed;
00230     
00238     SDOPackage::ServiceProfileList m_providerProfiles;
00239     coil::Mutex m_provider_mutex;
00240     
00248     std::vector<SdoServiceConsumerBase*> m_consumers;
00249     coil::Mutex m_consumer_mutex;
00250 
00258     ::RTC::Logger rtclog;
00259   };
00260 
00261 
00262 };
00263 
00264 #endif // RTC_SDOSERVICEADMIN_H