From 0d74d16093c9350205eb704b1aa6a4bcefa5667d Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Tue, 25 Aug 2015 13:44:46 -0700 Subject: lib: Made sensor_value_t copyable - Added copy ctor and assignment operator - Possibly ABI breaking --- host/lib/types/sensors.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'host/lib/types') diff --git a/host/lib/types/sensors.cpp b/host/lib/types/sensors.cpp index 52a63d14c..0406e35d4 100644 --- a/host/lib/types/sensors.cpp +++ b/host/lib/types/sensors.cpp @@ -69,6 +69,12 @@ sensor_value_t::sensor_value_t( /* NOP */ } +sensor_value_t::sensor_value_t(const sensor_value_t& source) +{ + *this = source; +} + + std::string sensor_value_t::to_pp_string(void) const{ switch(type){ case BOOLEAN: @@ -92,3 +98,12 @@ signed sensor_value_t::to_int(void) const{ double sensor_value_t::to_real(void) const{ return boost::lexical_cast(value); } + +sensor_value_t& sensor_value_t::operator=(const sensor_value_t& rhs) +{ + this->name = rhs.name; + this->value = rhs.value; + this->unit = rhs.unit; + this->type = rhs.type; + return *this; +} -- cgit v1.2.3