X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2FW1Device.hh;h=28d4d3852cf217fc17159e1a04698128e4ac0387;hb=e3fdbdfff2fc5e4ca6bc42e71ba8265c0e5c3719;hp=6ce09990ccf1962672e0055fad09e83ecf889d89;hpb=a7002b0a87c5f17b542dfbd44f482014a191df97;p=lib1wire.git diff --git a/src/W1Device.hh b/src/W1Device.hh index 6ce0999..28d4d38 100644 --- a/src/W1Device.hh +++ b/src/W1Device.hh @@ -13,8 +13,10 @@ #include #include +#include #include +#include #include #include @@ -32,12 +34,12 @@ namespace w1 { W1Device(std::string device_id_param, std::string device_type_param, dirent *direntry_param); - virtual ~W1Device(); + ~W1Device(); std::string get_name(); void set_name(std::string name_param); void printout(); plp::Data *get_data(); - plp::DataReader *get_device_data(); + const plp::DataReader *get_device_data(); protected: std::string dir_path; std::string slave_file; @@ -45,9 +47,10 @@ namespace w1 { plp::DataReader *reader; void save_and_clean_cache(); virtual std::vector *get_raw_data() = 0; - virtual unsigned int get_data_decimal_precision() = 0; - void cache(plp::Data *data); + virtual unsigned int get_data_decimal_precision() { return 1; } + void cache(plp::Data *new_data); std::string to_string(double val, int digit_count); + pthread_mutex_t plock; }; }