USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
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 
13 #include <uhd/utils/static.hpp>
14 #include <functional>
15 #include <memory>
16 #include <string>
17 
18 
19 namespace uhd { namespace extension {
20 
27 {
28 public:
32  struct factory_args
33  {
36  };
37 
38  using sptr = std::shared_ptr<extension>;
39  using factory_type = std::function<sptr(factory_args)>;
40 
41  virtual ~extension() = default;
42 
43  virtual std::string get_name() = 0;
44 
45  static void register_extension(
46  const std::string& extension_name, extension::factory_type factory_fn);
47 };
48 
49 
50 }} // namespace uhd::extension
51 
58 #define UHD_REGISTER_EXTENSION(NAME, CLASS_NAME) \
59  UHD_STATIC_BLOCK(register_extension_##NAME) \
60  { \
61  uhd::extension::extension::register_extension(#NAME, CLASS_NAME::make); \
62  }
uhd::extension::extension::factory_type
std::function< sptr(factory_args)> factory_type
Definition: extension.hpp:39
core_iface.hpp
radio_control.hpp
uhd::extension::extension::sptr
std::shared_ptr< extension > sptr
Definition: extension.hpp:38
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:34
uhd::extension::extension::factory_args::mb_ctrl
uhd::rfnoc::mb_controller::sptr mb_ctrl
Definition: extension.hpp:35
uhd::extension::extension
Definition: extension.hpp:24
uhd::extension::extension::factory_args
Definition: extension.hpp:32
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:29
uhd
Definition: build_info.hpp:12
uhd::rfnoc::rf_control::power_reference_iface
Definition: power_reference_iface.hpp:22
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