| USRP Hardware Driver and USRP Manual Version: 4.8.0.makepkg-0-g308126a4 UHD and USRP Manual |

Loading...
Searching...
No Matches
extension.hpp
Go to the documentation of this file.
1//
2// Copyright 2022 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
10#include <uhd/rfnoc/mb_controller.hpp>
11#include <uhd/rfnoc/radio_control.hpp>
12#include <uhd/rfnoc/rf_control/core_iface.hpp>
13#include <uhd/rfnoc/rf_control/power_reference_iface.hpp>
14#include <uhd/utils/noncopyable.hpp>
15#include <uhd/utils/static.hpp>
16#include <functional>
17#include <memory>
18#include <string>
19
20
21 namespace uhd { namespace extension {
22
26 class UHD_API extension : public uhd::noncopyable,
27 virtual public uhd::rfnoc::rf_control::core_iface,
28 public uhd::rfnoc::rf_control::power_reference_iface
29{
30 public:
34 struct factory_args
35 {
36 uhd::rfnoc::radio_control::sptr radio_ctrl;
37 uhd::rfnoc::mb_controller::sptr mb_ctrl;
38 };
39
40 using sptr = std::shared_ptr<extension>;
41 using factory_type = std::function<sptr(factory_args)>;
42
43 virtual ~extension() = default;
44
45 virtual std::string get_name() = 0;
46
47 static void register_extension(
48 const std::string& extension_name, extension::factory_type factory_fn);
49};
50
51
52}} // namespace uhd::extension
53
60#define UHD_REGISTER_EXTENSION(NAME, CLASS_NAME) \
61 UHD_STATIC_BLOCK(register_extension_##NAME) \
62 { \
63 uhd::extension::extension::register_extension(#NAME, CLASS_NAME::make); \
64 }
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