USRP Hardware Driver and USRP Manual  Version: 4.8.0.0
UHD and USRP Manual
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>
15 #include <uhd/utils/static.hpp>
16 #include <functional>
17 #include <memory>
18 #include <string>
19 
20 
21 namespace uhd { namespace extension {
22 
29 {
30 public:
34  struct factory_args
35  {
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::factory_type
std::function< sptr(factory_args)> factory_type
Definition: extension.hpp:41
core_iface.hpp
radio_control.hpp
config.hpp
uhd::extension::extension::sptr
std::shared_ptr< extension > sptr
Definition: extension.hpp:40
UHD_API
#define UHD_API
Definition: config.h:87
noncopyable.hpp
uhd::extension::extension::factory_args::radio_ctrl
uhd::rfnoc::radio_control::sptr radio_ctrl
Definition: extension.hpp:36
uhd::extension::extension::factory_args::mb_ctrl
uhd::rfnoc::mb_controller::sptr mb_ctrl
Definition: extension.hpp:37
uhd::extension::extension
Definition: extension.hpp:26
uhd::extension::extension::factory_args
Definition: extension.hpp:34
uhd::rfnoc::rf_control::core_iface
Definition: core_iface.hpp:25
uhd::rfnoc::mb_controller::sptr
std::shared_ptr< mb_controller > sptr
Definition: mb_controller.hpp:33
uhd
Definition: build_info.hpp:12
uhd::rfnoc::rf_control::power_reference_iface
Definition: power_reference_iface.hpp:22
power_reference_iface.hpp
static.hpp
uhd::rfnoc::noc_block_base::sptr
std::shared_ptr< noc_block_base > sptr
Definition: noc_block_base.hpp:48
uhd::noncopyable
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
mb_controller.hpp