summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-07-15 15:20:56 -0700
committerJosh Blum <josh@joshknows.com>2013-07-15 15:20:56 -0700
commita7153fecdb1416df03f21467c52dbb35cb675f6f (patch)
tree04473eaaa56aef63597d0daf937d451ebcc28fb6 /host
parentead07058f1d6f24ed390081df83044099b171a85 (diff)
downloaduhd-a7153fecdb1416df03f21467c52dbb35cb675f6f.tar.gz
uhd-a7153fecdb1416df03f21467c52dbb35cb675f6f.tar.bz2
uhd-a7153fecdb1416df03f21467c52dbb35cb675f6f.zip
uhd: added virtual destructors for several interface classes
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/stream.hpp4
-rw-r--r--host/include/uhd/types/serial.hpp8
-rw-r--r--host/include/uhd/usrp/dboard_iface.hpp4
-rw-r--r--host/lib/CMakeLists.txt3
-rw-r--r--host/lib/stream.cpp30
-rw-r--r--host/lib/types/serial.cpp17
-rw-r--r--host/lib/usrp/dboard_iface.cpp7
7 files changed, 68 insertions, 5 deletions
diff --git a/host/include/uhd/stream.hpp b/host/include/uhd/stream.hpp
index c8ab303ad..c05e8a1e9 100644
--- a/host/include/uhd/stream.hpp
+++ b/host/include/uhd/stream.hpp
@@ -124,6 +124,8 @@ class UHD_API rx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<rx_streamer> sptr;
+ virtual ~rx_streamer(void);
+
//! Get the number of channels associated with this streamer
virtual size_t get_num_channels(void) const = 0;
@@ -181,6 +183,8 @@ class UHD_API tx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<tx_streamer> sptr;
+ virtual ~tx_streamer(void);
+
//! Get the number of channels associated with this streamer
virtual size_t get_num_channels(void) const = 0;
diff --git a/host/include/uhd/types/serial.hpp b/host/include/uhd/types/serial.hpp
index f66822775..5b69d07f6 100644
--- a/host/include/uhd/types/serial.hpp
+++ b/host/include/uhd/types/serial.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -46,6 +46,8 @@ namespace uhd{
public:
typedef boost::shared_ptr<i2c_iface> sptr;
+ virtual ~i2c_iface(void);
+
/*!
* Write bytes over the i2c.
* \param addr the address
@@ -128,6 +130,8 @@ namespace uhd{
public:
typedef boost::shared_ptr<spi_iface> sptr;
+ virtual ~spi_iface(void);
+
/*!
* Perform a spi transaction.
* \param which_slave the slave device number
@@ -182,6 +186,8 @@ namespace uhd{
public:
typedef boost::shared_ptr<uart_iface> sptr;
+ virtual ~uart_iface(void);
+
/*!
* Write to a serial port.
* \param buf the data to write
diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp
index 6a6a68321..b0f92e2ab 100644
--- a/host/include/uhd/usrp/dboard_iface.hpp
+++ b/host/include/uhd/usrp/dboard_iface.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -290,6 +290,8 @@ private:
protected:
dboard_iface(void);
+public:
+ virtual ~dboard_iface(void);
};
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index a37a8ab85..4ca06af9a 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2010-2011,2013 Ettus Research LLC
+# Copyright 2010-2013 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
@@ -88,6 +88,7 @@ CONFIGURE_FILE(
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/deprecated.cpp
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/stream.cpp
${CMAKE_CURRENT_SOURCE_DIR}/exception.cpp
${CMAKE_CURRENT_SOURCE_DIR}/property_tree.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
diff --git a/host/lib/stream.cpp b/host/lib/stream.cpp
new file mode 100644
index 000000000..9fafad9ec
--- /dev/null
+++ b/host/lib/stream.cpp
@@ -0,0 +1,30 @@
+//
+// Copyright 2013 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
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#include <uhd/stream.hpp>
+
+using namespace uhd;
+
+rx_streamer::~rx_streamer(void)
+{
+ //empty
+}
+
+tx_streamer::~tx_streamer(void)
+{
+ //empty
+}
diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp
index 9e9d32954..562261bb7 100644
--- a/host/lib/types/serial.cpp
+++ b/host/lib/types/serial.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2013 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
@@ -21,6 +21,21 @@
using namespace uhd;
+i2c_iface::~i2c_iface(void)
+{
+ //empty
+}
+
+spi_iface::~spi_iface(void)
+{
+ //empty
+}
+
+uart_iface::~uart_iface(void)
+{
+ //empty
+}
+
spi_config_t::spi_config_t(edge_t edge):
mosi_edge(edge),
miso_edge(edge)
diff --git a/host/lib/usrp/dboard_iface.cpp b/host/lib/usrp/dboard_iface.cpp
index 5cc5ea470..6be50130a 100644
--- a/host/lib/usrp/dboard_iface.cpp
+++ b/host/lib/usrp/dboard_iface.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -31,6 +31,11 @@ dboard_iface::dboard_iface(void){
_impl = UHD_PIMPL_MAKE(impl, ());
}
+dboard_iface::~dboard_iface(void)
+{
+ //empty
+}
+
template <typename T>
static T shadow_it(T &shadow, const T &value, const T &mask){
shadow = (shadow & ~mask) | (value & mask);