From d769ff8cc3dbb579b3c050a9b184f2bdd5c9a71d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 24 Jul 2010 00:11:44 -0700 Subject: usrp: removed gain handler code (replaced by gain group) --- host/include/uhd/utils/CMakeLists.txt | 1 - host/include/uhd/utils/gain_handler.hpp | 90 --------------------------------- 2 files changed, 91 deletions(-) delete mode 100644 host/include/uhd/utils/gain_handler.hpp (limited to 'host/include') diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt index 4a5f20e3c..f7feab5a8 100644 --- a/host/include/uhd/utils/CMakeLists.txt +++ b/host/include/uhd/utils/CMakeLists.txt @@ -23,7 +23,6 @@ INSTALL(FILES byteswap.ipp exception.hpp gain_group.hpp - gain_handler.hpp pimpl.hpp props.hpp safe_main.hpp diff --git a/host/include/uhd/utils/gain_handler.hpp b/host/include/uhd/utils/gain_handler.hpp deleted file mode 100644 index f4629e6a7..000000000 --- a/host/include/uhd/utils/gain_handler.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// Copyright 2010 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 . -// - -#ifndef INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP -#define INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP - -#include -#include -#include -#include - -namespace uhd{ - -class UHD_API gain_handler{ -public: - typedef boost::shared_ptr sptr; - typedef boost::function is_equal_t; - - /*! - * A set of properties for dealing with gains. - */ - struct UHD_API props_t{ - wax::obj value, range, names; - props_t(void); //default constructor - }; - - /*! - * Make a new gain handler. - * The construction arguments are agnostic to the property type. - * It is up to the caller to provide an "is_equal" function that - * can tell weather two properties (in a wax obj) are equal. - * \param link a link to the wax obj with properties - * \param props a struct of properties keys - * \param is_equal the function that tests for equal properties - */ - static sptr make( - const wax::obj &link, - const props_t &props, - is_equal_t is_equal - ); - - /*! - * Intercept gets for overall gain, min, max, step. - * Ensures that the gain name is valid. - * \return true for handled, false to pass on - */ - virtual bool intercept_get(const wax::obj &key, wax::obj &val) = 0; - - /*! - * Intercept sets for overall gain. - * Ensures that the gain name is valid. - * Ensures that the new gain is within range. - * \return true for handled, false to pass on - */ - virtual bool intercept_set(const wax::obj &key, const wax::obj &val) = 0; - - /*! - * Function template to test if two wax types are equal: - * The constructor will bind an instance of this for a specific type. - * This bound equals functions allows the intercept methods to be non-templated. - */ - template static bool is_equal(const wax::obj &a, const wax::obj &b){ - try{ - return a.as() == b.as(); - } - catch(const wax::bad_cast &){ - return false; - } - } - -}; - -} //namespace uhd - -#endif /* INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP */ - -- cgit v1.2.3