Loading...
Searching...
No Matches
extension.hpp
Go to the documentation of this file.
//
// Copyright 2022 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/rfnoc/mb_controller.hpp>
#include <uhd/rfnoc/radio_control.hpp>
#include <uhd/rfnoc/rf_control/core_iface.hpp>
#include <uhd/rfnoc/rf_control/power_reference_iface.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <uhd/utils/static.hpp>
#include <functional>
#include <memory>
#include <string>
namespace uhd { namespace extension {
class UHD_API extension : public uhd::noncopyable,
virtual public uhd::rfnoc::rf_control::core_iface,
public uhd::rfnoc::rf_control::power_reference_iface
{
public:
struct factory_args
{
uhd::rfnoc::radio_control::sptr radio_ctrl;
uhd::rfnoc::mb_controller::sptr mb_ctrl;
};
using sptr = std::shared_ptr<extension>;
using factory_type = std::function<sptr(factory_args)>;
virtual ~extension() = default;
virtual std::string get_name() = 0;
static void register_extension(
const std::string& extension_name, extension::factory_type factory_fn);
};
}} // namespace uhd::extension
#define UHD_REGISTER_EXTENSION(NAME, CLASS_NAME) \
UHD_STATIC_BLOCK(register_extension_##NAME) \
{ \
uhd::extension::extension::register_extension(#NAME, CLASS_NAME::make); \
}
uhd::extension::extension
Definition extension.hpp:29
uhd::extension::extension::factory_type
std::function< sptr(factory_args)> factory_type
Definition extension.hpp:41
uhd::extension::extension::get_name
virtual std::string get_name()=0
uhd::extension::extension::sptr
std::shared_ptr< extension > sptr
Definition extension.hpp:40
uhd::extension::extension::register_extension
static void register_extension(const std::string &extension_name, extension::factory_type factory_fn)
uhd::extension::extension::~extension
virtual ~extension()=default
uhd::rfnoc::mb_controller::sptr
std::shared_ptr< mb_controller > sptr
Definition mb_controller.hpp:33
uhd::rfnoc::noc_block_base::sptr
std::shared_ptr< noc_block_base > sptr
Definition noc_block_base.hpp:48
uhd::rfnoc::rf_control::core_iface
Definition core_iface.hpp:26
uhd::rfnoc::rf_control::power_reference_iface
Definition power_reference_iface.hpp:23
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
core_iface.hpp
mb_controller.hpp
uhd
Definition build_info.hpp:12
uhd::noncopyable
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
noncopyable.hpp
power_reference_iface.hpp
radio_control.hpp
static.hpp
uhd::extension::extension::factory_args
Definition extension.hpp:35
uhd::extension::extension::factory_args::mb_ctrl
uhd::rfnoc::mb_controller::sptr mb_ctrl
Definition extension.hpp:37
uhd::extension::extension::factory_args::radio_ctrl
uhd::rfnoc::radio_control::sptr radio_ctrl
Definition extension.hpp:36