query.h 857 Bytes
Newer Older
Axel Auweter's avatar
Axel Auweter committed
1
2
3
4
5
6
7
8
9
10
/*
 * query.cpp
 *
 *  Created on: Feb 20, 2015
 *      Author: Axel Auweter
 */

#include <list>
#include <string>

Axel Auweter's avatar
Axel Auweter committed
11
#include "dcdb/connection.h"
Axel Auweter's avatar
Axel Auweter committed
12
#include "dcdb/timestamp.h"
Axel Auweter's avatar
Axel Auweter committed
13
#include "dcdb/sensorid.h"
Axel Auweter's avatar
Axel Auweter committed
14
#include "dcdb/sensordatastore.h"
Axel Auweter's avatar
Axel Auweter committed
15
#include "dcdb/sensorconfig.h"
Axel Auweter's avatar
Axel Auweter committed
16
#include "dcdb/unitconv.h"
Axel Auweter's avatar
Axel Auweter committed
17
18
19
20
21
22

#ifndef QUERY_H
#define QUERY_H

class DCDBQuery
{
Axel Auweter's avatar
Axel Auweter committed
23
24
25
26
protected:
  DCDBConnection* connection;
  bool useLocalTime;
  bool useRawOutput;
Axel Auweter's avatar
Axel Auweter committed
27
  bool useFloatOutput;
Axel Auweter's avatar
Axel Auweter committed
28

Axel Auweter's avatar
Axel Auweter committed
29
public:
Axel Auweter's avatar
Axel Auweter committed
30
31
32
33
  void setLocalTimeEnabled(bool enable);
  bool getLocalTimeEnabled();
  void setRawOutputEnabled(bool enable);
  bool getRawOutputEnabled();
Axel Auweter's avatar
Axel Auweter committed
34
35
  void setFloatOutputEnabled(bool enable);
  bool getFloatOutputEnabled();
Axel Auweter's avatar
Axel Auweter committed
36
37
  void doQuery(const char* hostname, std::list<std::string> sensors, DCDBTimeStamp start, DCDBTimeStamp end);

Axel Auweter's avatar
Axel Auweter committed
38
  DCDBQuery();
Axel Auweter's avatar
Axel Auweter committed
39
  virtual ~DCDBQuery() {};
Axel Auweter's avatar
Axel Auweter committed
40
41
42
43
44

};


#endif /* QUERY_H */