]> pilppa.org Git - lib1wire.git/blob - src/DeviceData.hh
Support for querying the list devices having data stored.
[lib1wire.git] / src / DeviceData.hh
1 /*
2  * DeviceData.hh
3  *
4  *  Created on: Nov 7, 2010
5  *      Author: lamikr
6  */
7
8 #ifndef W1DATALIST_H_
9 #define W1DATALIST_H_
10
11 #include <string>
12 #include <vector>
13
14 #include "Data.hh"
15 #include "Date.hh"
16 #include "DeviceConfig.hh"
17
18 #include <time.h>
19
20 namespace w1 {
21         class DeviceData {
22                 public:
23                         DeviceData(std::string device_id);
24                         virtual ~DeviceData();
25                         DataRange *get_data_range();
26                         /**
27                          * Get summary data calculated from the daily data items that is meaning full.
28                          * Depending from the device type, it may be daily mean value, daily delta, highest value, etc...
29                          */
30                         Data *get_daily_summary(plp::Date *date);
31                         DataRange *get_daily_summary(plp::Date *start_date, plp::Date *end_date);
32                         DataRange *get_data(plp::Date *start_date, plp::Date *end_date);
33                 protected:
34                         std::string                     device_id;
35                         std::string                     device_dir;
36                         std::string                     device_ch_dir;
37                         w1::DeviceConfig                *device_config;
38                         enum_summary_calculation        summary_calc_type;
39                         Data *find_oldest_data(std::vector<std::string> year_vector);
40                         Data *find_newest_data(std::vector<std::string> year_vector);
41         };
42 }
43
44 #endif /* W1DATALIST_H_ */