Loading...
Searching...
No Matches
nameless_gain_mixin.hpp
Go to the documentation of this file.
//
// Copyright 2021 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/property_tree.hpp>
#include <uhd/rfnoc/rf_control/core_iface.hpp>
#include <uhd/types/direction.hpp>
#include <unordered_map>
#include <functional>
#include <memory>
#include <string>
#include <vector>
namespace uhd { namespace rfnoc { namespace rf_control {
class UHD_API nameless_gain_mixin : virtual public core_iface
{
public:
using name_selector =
std::function<std::string(const uhd::direction_t trx, const size_t chan)>;
nameless_gain_mixin(name_selector name_selector);
virtual ~nameless_gain_mixin() = default;
double set_tx_gain(const double gain, const size_t chan) override;
double get_tx_gain(const size_t chan) override;
double set_rx_gain(const double gain, const size_t chan) override;
double get_rx_gain(const size_t chan) override;
// Getting the gain ranges is a bit different - these always use the empty name
gain_range_t get_tx_gain_range(const size_t chan) const override;
gain_range_t get_rx_gain_range(const size_t chan) const override;
private:
name_selector _name_selector;
using core_iface::get_tx_gain;
using core_iface::get_tx_gain_range;
using core_iface::set_tx_gain;
using core_iface::get_rx_gain;
using core_iface::get_rx_gain_range;
using core_iface::set_rx_gain;
};
}}} // namespace uhd::rfnoc::rf_control
uhd::rfnoc::rf_control::core_iface
Definition core_iface.hpp:26
uhd::rfnoc::rf_control::core_iface::get_rx_gain
virtual double get_rx_gain(const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::get_tx_gain
virtual double get_tx_gain(const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::set_tx_gain
virtual double set_tx_gain(const double gain, const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::set_rx_gain
virtual double set_rx_gain(const double gain, const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::get_rx_gain_range
virtual uhd::gain_range_t get_rx_gain_range(const size_t chan) const =0
uhd::rfnoc::rf_control::core_iface::get_tx_gain_range
virtual uhd::gain_range_t get_tx_gain_range(const size_t chan) const =0
uhd::rfnoc::rf_control::nameless_gain_mixin::set_tx_gain
double set_tx_gain(const double gain, const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::get_rx_gain
double get_rx_gain(const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::nameless_gain_mixin
nameless_gain_mixin(name_selector name_selector)
uhd::rfnoc::rf_control::nameless_gain_mixin::get_tx_gain
double get_tx_gain(const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::get_rx_gain_range
gain_range_t get_rx_gain_range(const size_t chan) const override
uhd::rfnoc::rf_control::nameless_gain_mixin::name_selector
std::function< std::string(const uhd::direction_t trx, const size_t chan)> name_selector
Definition nameless_gain_mixin.hpp:25
uhd::rfnoc::rf_control::nameless_gain_mixin::set_rx_gain
double set_rx_gain(const double gain, const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::~nameless_gain_mixin
virtual ~nameless_gain_mixin()=default
uhd::rfnoc::rf_control::nameless_gain_mixin::get_tx_gain_range
gain_range_t get_tx_gain_range(const size_t chan) const override
UHD_API
#define UHD_API
Definition config.h:87
core_iface.hpp
direction.hpp
uhd::rfnoc::rf_control
Definition antenna_iface.hpp:17
uhd::rfnoc
Definition actions.hpp:24
uhd
Definition build_info.hpp:12
uhd::direction_t
direction_t
Definition direction.hpp:12
uhd::gain_range_t
meta_range_t gain_range_t
Definition ranges.hpp:130
property_tree.hpp