X-Git-Url: http://pilppa.org/gitweb/?p=lib1wire.git;a=blobdiff_plain;f=src%2FW1Device.hh;h=28d4d3852cf217fc17159e1a04698128e4ac0387;hp=a9303030859cc5c0713ca48259f2cab36f4129b9;hb=14ca6b205211e856c924f88dff3abf0584b1e414;hpb=557fe3a639d7bd6fd146fdc9d573cf53bb2adff0 diff --git a/src/W1Device.hh b/src/W1Device.hh index a930303..28d4d38 100644 --- a/src/W1Device.hh +++ b/src/W1Device.hh @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -33,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; @@ -46,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; }; }