summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-07-04 13:40:19 -0700
committerJosh Blum <josh@joshknows.com>2012-07-04 13:40:19 -0700
commitd61c9b29b357579aa41928c225d137645144e20d (patch)
treee9fe7ee72a49283f95b745e566a509c1b3993c94 /host/lib
parent45c1af8152d02cd7d4e5d5d603e1cca65f6dd539 (diff)
downloaduhd-d61c9b29b357579aa41928c225d137645144e20d.tar.gz
uhd-d61c9b29b357579aa41928c225d137645144e20d.tar.bz2
uhd-d61c9b29b357579aa41928c225d137645144e20d.zip
uhd: make range_t a lightweight object
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/types/ranges.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/host/lib/types/ranges.cpp b/host/lib/types/ranges.cpp
index 6e39bc688..82a9a84e1 100644
--- a/host/lib/types/ranges.cpp
+++ b/host/lib/types/ranges.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2011 Ettus Research LLC
+// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -27,17 +27,8 @@ using namespace uhd;
/***********************************************************************
* range_t implementation code
**********************************************************************/
-struct range_t::impl{
- impl(double start, double stop, double step):
- start(start), stop(stop), step(step)
- {
- /* NOP */
- }
- double start, stop, step;
-};
-
range_t::range_t(double value):
- _impl(UHD_PIMPL_MAKE(impl, (value, value, 0)))
+ _start(value), _stop(value), _step(0.0)
{
/* NOP */
}
@@ -45,7 +36,7 @@ range_t::range_t(double value):
range_t::range_t(
double start, double stop, double step
):
- _impl(UHD_PIMPL_MAKE(impl, (start, stop, step)))
+ _start(start), _stop(stop), _step(step)
{
if (stop < start){
throw uhd::value_error("cannot make range where stop < start");
@@ -53,15 +44,15 @@ range_t::range_t(
}
double range_t::start(void) const{
- return _impl->start;
+ return _start;
}
double range_t::stop(void) const{
- return _impl->stop;
+ return _stop;
}
double range_t::step(void) const{
- return _impl->step;
+ return _step;
}
const std::string range_t::to_pp_string(void) const{