]> pilppa.org Git - lib1wire.git/blob - src/Factory.hh
Support for querying the list devices having data stored.
[lib1wire.git] / src / Factory.hh
1 /*
2  * Factory.hh
3  *
4  *  Created on: Dec 11, 2010
5  *      Author: lamikr
6  */
7
8 #ifndef FACTORY_HH_
9 #define FACTORY_HH_
10
11 #include <string>
12
13 #include <dirent.h>
14
15 #include "DeviceConfig.hh"
16 #include "DeviceData.hh"
17 #include "W1Device.hh"
18
19 #ifndef W1_SCAN_ROOTDIR
20         #define W1_SCAN_ROOTDIR         "/sys/bus/w1/devices"
21 #endif
22
23 namespace w1 {
24         class Factory {
25                 public:
26                         Factory();
27                         virtual ~Factory();
28                         static W1Device *get_device(int family_code, std::string device_id, dirent *direntry_param);
29                         static std::list<W1Device *> get_device_list();
30                         static std::list<DeviceData *> get_device_data_list();
31                         static DeviceConfig *get_device_config(std::string device_id);
32                 private:
33                         //int parse_family_code(std::string folder_name);
34                         static W1Device *create_device(dirent *direntry_param);
35         };
36 }
37
38 #endif /* FACTORY_HH_ */