]> pilppa.org Git - lib1wire.git/blob - src/Factory.hh
cleanups
[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 #include <list>
13
14 #include <dirent.h>
15
16 #include <plp/DeviceConfig.hh>
17 #include <plp/DataReader.hh>
18 #include <plp/Device.hh>
19
20 #ifndef W1_SCAN_ROOTDIR
21         #define W1_SCAN_ROOTDIR         "/sys/bus/w1/devices"
22 #endif
23
24 namespace w1 {
25         class Factory {
26                 public:
27                         Factory();
28                         virtual ~Factory();
29                         static std::list<plp::Device *> get_device_list();
30                 private:
31                         //int parse_family_code(string folder_name);
32                         static plp::Device *create_w1_device(int family_code_param, string device_type_param, string device_id_param, dirent *direntry_param);
33                         static plp::Device *create_w1_device(int family_code, string device_id, dirent *direntry_param);
34                         static plp::Device *create_w1_device(string device_type_param, string device_id_param);
35                         static plp::Device *create_w1_device(dirent *direntry_param, int *err_code_param);
36                         static std::list<plp::DataReader *> get_data_reader_list();
37                         static int get_family_code_by_device_type(string device_type_param);
38                         static string get_device_type_by_family_code(int family_code_param);
39         };
40 }
41
42 #endif /* FACTORY_HH_ */