aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-08-25 13:44:46 -0700
committerAshish Chaudhari <ashish@ettus.com>2016-02-11 14:36:20 -0800
commit0d74d16093c9350205eb704b1aa6a4bcefa5667d (patch)
treedf9a27fb73a00da8ad5724bf2be41c14fc3af3be /host/lib
parente9bd85c60b5de5f2979d8bf2886d3931aa03f1c8 (diff)
downloaduhd-0d74d16093c9350205eb704b1aa6a4bcefa5667d.tar.gz
uhd-0d74d16093c9350205eb704b1aa6a4bcefa5667d.tar.bz2
uhd-0d74d16093c9350205eb704b1aa6a4bcefa5667d.zip
lib: Made sensor_value_t copyable
- Added copy ctor and assignment operator - Possibly ABI breaking
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/types/sensors.cpp15
1 files changed, 15 insertions, 0 deletions
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<double>(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;
+}