| USRP Hardware Driver and Device Manual Version: 4.10.0.0 UHD and USRP Manual |

Loading...
Searching...
No Matches
gain_group.hpp
Go to the documentation of this file.
1//
2// Copyright 2010-2011,2014 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#pragma once
9
10#include <uhd/config.hpp>
11#include <uhd/types/ranges.hpp>
12#include <uhd/utils/noncopyable.hpp>
13#include <cstddef>
14#include <functional>
15#include <memory>
16#include <string>
17#include <vector>
18
19 namespace uhd {
20
24 struct UHD_API gain_fcns_t
25{
26 std::function<gain_range_t(void)> get_range;
27 std::function<double(void)> get_value;
28 std::function<void(double)> set_value;
29};
30
31 class UHD_API gain_group : uhd::noncopyable
32{
33 public:
34 typedef std::shared_ptr<gain_group> sptr;
35
36 virtual ~gain_group(void) = 0;
37
45 virtual gain_range_t get_range(const std::string& name = "") = 0;
46
53 virtual double get_value(const std::string& name = "") = 0;
54
63 virtual void set_value(double gain, const std::string& name = "") = 0;
64
70 virtual const std::vector<std::string> get_names(void) = 0;
71
86 virtual void register_fcns(
87 const std::string& name, const gain_fcns_t& gain_fcns, size_t priority = 0) = 0;
88
93 static sptr make(void);
94
99 static sptr make_zero();
100};
101
102} // namespace uhd
uhd::gain_group
Definition gain_group.hpp:32
uhd::gain_group::register_fcns
virtual void register_fcns(const std::string &name, const gain_fcns_t &gain_fcns, size_t priority=0)=0
uhd::gain_group::get_names
virtual const std::vector< std::string > get_names(void)=0
uhd::gain_group::get_range
virtual gain_range_t get_range(const std::string &name="")=0
uhd::gain_group::set_value
virtual void set_value(double gain, const std::string &name="")=0
uhd::gain_group::get_value
virtual double get_value(const std::string &name="")=0
uhd::gain_group::sptr
std::shared_ptr< gain_group > sptr
Definition gain_group.hpp:34
uhd::gain_group::make
static sptr make(void)
uhd::gain_group::make_zero
static sptr make_zero()
uhd::gain_group::~gain_group
virtual ~gain_group(void)=0
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
uhd
Definition build_info.hpp:12
uhd::noncopyable
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
uhd::gain_range_t
meta_range_t gain_range_t
Definition ranges.hpp:170
noncopyable.hpp
ranges.hpp
uhd::gain_fcns_t
Definition gain_group.hpp:25
uhd::gain_fcns_t::set_value
std::function< void(double)> set_value
Definition gain_group.hpp:28
uhd::gain_fcns_t::get_range
std::function< gain_range_t(void)> get_range
Definition gain_group.hpp:26
uhd::gain_fcns_t::get_value
std::function< double(void)> get_value
Definition gain_group.hpp:27