libalextractor  1.14
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
alextractor.h
Go to the documentation of this file.
1 
10 #pragma once
11 #ifndef _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_
12 #define _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_
13 
14 # include <alcommon/almodule.h>
15 # include <alextractor/config.h>
16 
17 # include <boost/scoped_ptr.hpp>
18 
19 namespace AL
20 {
21  class ALBroker;
22  class ALExtractorPrivate;
23 
32  class ALEXTRACTOR_API ALExtractor: public ALModule
33  {
34  public:
42  ALExtractor(boost::shared_ptr<ALBroker> pBroker,
43  const std::string& pName);
44 
46  virtual ~ALExtractor();
47 
55  virtual void subscribe(const std::string &pSubscribedName,
56  const int &pPeriod,
57  const float &pPrecision);
58 
66  void subscribe(const std::string &pSubscribedName);
67 
68 
74  virtual void updatePeriod(const std::string &pSubscribedName,
75  const int &pPeriod);
76 
82  virtual void updatePrecision(const std::string &pSubscribedName,
83  const float &pPrecision);
84 
90  virtual void unsubscribe(const std::string &pSubscribedName);
91 
97  virtual int getCurrentPeriod();
98 
104  virtual float getCurrentPrecision();
105 
111  virtual int getMyPeriod(const std::string &pSubscribedName);
112 
118  virtual float getMyPrecision(const std::string &pSubscribedName);
119 
125  ALValue getSubscribersInfo();
126 
131  virtual std::string httpGet();
132 
133  protected:
134 
143  virtual void xStartDetection(const int pPeriod,
144  const float pPrecision) = 0;
145 
155  virtual void xUpdateParameters(const int pPeriod, const float pPrecision);
156 
162  virtual void xStopDetection() = 0;
163 
164 
172  virtual int getDefaultPeriod();
173 
181  virtual float getDefaultPrecision();
182 
183 
188  std::vector<std::string> getOutputNames(void);
189 
190  private:
192  boost::scoped_ptr<ALExtractorPrivate> _private;
196  void xUpdateParameters();
197  };
198 } // namespace AL
199 
200 #endif // _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_
201