USRP Hardware Driver and USRP Manual  Version: 4.6.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 
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  }
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
std::function< sptr(factory_args)> factory_type
Definition: extension.hpp:39
Definition: extension.hpp:24
Definition: build_info.hpp:12
uhd::rfnoc::radio_control::sptr radio_ctrl
Definition: extension.hpp:34
Definition: extension.hpp:32
Definition: core_iface.hpp:25
Definition: power_reference_iface.hpp:22
uhd::rfnoc::mb_controller::sptr mb_ctrl
Definition: extension.hpp:35
std::shared_ptr< mb_controller > sptr
Definition: mb_controller.hpp:30
std::shared_ptr< noc_block_base > sptr
Definition: noc_block_base.hpp:48
#define UHD_API
Definition: config.h:87
std::shared_ptr< extension > sptr
Definition: extension.hpp:38