00001 // -*- C++ -*- 00019 #ifndef RTM_LOCALSERVICEBASE_H 00020 #define RTM_LOCALSERVICEBASE_H 00021 00022 #include <vector> 00023 00024 #include <coil/Mutex.h> 00025 #include <coil/Factory.h> 00026 #include <coil/Timer.h> 00027 #include <coil/Properties.h> 00028 00029 namespace RTM 00030 { 00031 00032 // forward decl 00033 class LocalServiceBase; 00034 00042 class LocalServiceProfile 00043 { 00044 public: 00052 std::string name; 00060 std::string uuid; 00068 coil::Properties properties; 00076 LocalServiceBase* service; 00077 }; 00078 00086 typedef std::vector<LocalServiceProfile> LocalServiceProfileList; 00087 00189 class LocalServiceBase 00190 { 00191 public: 00199 virtual ~LocalServiceBase() 00200 { 00201 } 00202 00218 virtual bool 00219 init(const coil::Properties& props) = 0; 00236 virtual bool 00237 reinit(const coil::Properties& props) = 0; 00238 00256 virtual const LocalServiceProfile& 00257 getProfile() const = 0; 00258 00273 virtual void 00274 finalize() = 0; 00275 }; 00276 00284 typedef ::coil::GlobalFactory< ::RTM::LocalServiceBase > LocalServiceFactory; 00285 00286 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 00287 00294 EXTERN template class DLL_PLUGIN 00295 ::coil::GlobalFactory< ::RTM::LocalServiceBase >; 00296 #endif 00297 }; // namespace RTM 00298 00299 #endif // RTM_LOCALSERVICEBASE_H