libalextractor
1.12
|
00001 00010 #pragma once 00011 #ifndef _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_ 00012 #define _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_ 00013 00014 # include <alcommon/almodule.h> 00015 # include <alextractor/config.h> 00016 00017 # include <boost/scoped_ptr.hpp> 00018 00019 namespace AL 00020 { 00021 class ALBroker; 00022 class ALExtractorPrivate; 00023 00032 class ALEXTRACTOR_API ALExtractor: public ALModule 00033 { 00034 public: 00042 ALExtractor(boost::shared_ptr<ALBroker> pBroker, 00043 const std::string& pName); 00044 00046 virtual ~ALExtractor(); 00047 00055 virtual void subscribe(const std::string &pSubscribedName, 00056 const int &pPeriod, 00057 const float &pPrecision); 00058 00064 void subscribe(const std::string &pSubscribedName); 00065 00066 00072 virtual void updatePeriod(const std::string &pSubscribedName, 00073 const int &pPeriod); 00074 00080 virtual void updatePrecision(const std::string &pSubscribedName, 00081 const float &pPrecision); 00082 00088 virtual void unsubscribe(const std::string &pSubscribedName); 00089 00095 virtual int getCurrentPeriod(); 00096 00102 virtual float getCurrentPrecision(); 00103 00109 virtual int getMyPeriod(const std::string &pSubscribedName); 00110 00116 virtual float getMyPrecision(const std::string &pSubscribedName); 00117 00123 ALValue getSubscribersInfo(); 00124 00129 virtual std::string httpGet(); 00130 00131 protected: 00132 00141 virtual void xStartDetection(const int pPeriod, 00142 const float pPrecision) = 0; 00143 00153 virtual void xUpdateParameters(const int pPeriod, const float pPrecision); 00154 00160 virtual void xStopDetection() = 0; 00161 00166 std::vector<std::string> getOutputNames(void); 00167 00168 private: 00170 boost::scoped_ptr<ALExtractorPrivate> _private; 00174 void xUpdateParameters(); 00175 }; 00176 } // namespace AL 00177 00178 #endif // _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_ 00179