libalextractor  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 #include <boost/shared_ptr.hpp>
19 #include <boost/thread/mutex.hpp>
20 #include <boost/thread/shared_mutex.hpp>
21 
22 namespace AL
23 {
24  class ALBroker;
25  class ALExtractorPrivate;
26 
35  class ALEXTRACTOR_API ALExtractor: public ALModule
36  {
37  public:
45  ALExtractor(boost::shared_ptr<ALBroker> pBroker,
46  const std::string& pName);
47 
49  virtual ~ALExtractor();
50 
58  virtual void subscribe(const std::string &pSubscribedName,
59  const int &pPeriod,
60  const float &pPrecision);
61 
69  virtual void subscribe(const std::string &pSubscribedName);
70 
71 
77  virtual void updatePeriod(const std::string &pSubscribedName,
78  const int &pPeriod);
79 
85  virtual void updatePrecision(const std::string &pSubscribedName,
86  const float &pPrecision);
87 
93  virtual void unsubscribe(const std::string &pSubscribedName);
94 
100  virtual int getCurrentPeriod();
101 
107  virtual float getCurrentPrecision();
108 
114  virtual int getMyPeriod(const std::string &pSubscribedName);
115 
121  virtual float getMyPrecision(const std::string &pSubscribedName);
122 
128  ALValue getSubscribersInfo();
129 
134  virtual std::string httpGet();
135 
136  protected:
137 
146  virtual void xStartDetection(const int pPeriod,
147  const float pPrecision) = 0;
148 
158  virtual void xUpdateParameters(const int pPeriod, const float pPrecision) {}
159 
165  virtual void xStopDetection() = 0;
166 
167 
175  virtual int getDefaultPeriod();
176 
184  virtual float getDefaultPrecision();
185 
186 
194  virtual int getMinimumPeriod();
195 
203  virtual int getMaximumPeriod();
204 
209  virtual std::vector<std::string> getOutputNames(void);
210 
215  std::vector<std::string> getEventList(void);
216 
221  std::vector<std::string> getMemoryKeyList(void);
222 
226  void declareEvent(const std::string& event);
227 
231  void declareMemoryKey(const std::string& key);
232 
233  private:
235  boost::scoped_ptr<ALExtractorPrivate> _private;
239  void xUpdateParameters();
240 
241 
242  boost::mutex fSubscriptionMutex;
243  };
244 } // namespace AL
245 
246 #endif // _LIBALEXTRACTOR_ALEXTRACTOR_ALEXTRACTOR_H_
247 
dll import/export
ALExtractor class implements an extractor.
Definition: alextractor.h:35
virtual void xUpdateParameters(const int pPeriod, const float pPrecision)
Enables to do some custom updates when the period and/or the precision have been updated.
Definition: alextractor.h:158