USRP Hardware Driver and USRP Manual Version: 20250207.0.git0dede88c.fc40
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>
15#include <uhd/utils/static.hpp>
16#include <functional>
17#include <memory>
18#include <string>
19
20
21namespace uhd { namespace extension {
22
29{
30public:
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 }
Definition extension.hpp:29
std::function< sptr(factory_args)> factory_type
Definition extension.hpp:41
virtual std::string get_name()=0
std::shared_ptr< extension > sptr
Definition extension.hpp:40
static void register_extension(const std::string &extension_name, extension::factory_type factory_fn)
virtual ~extension()=default
std::shared_ptr< mb_controller > sptr
Definition mb_controller.hpp:33
std::shared_ptr< noc_block_base > sptr
Definition noc_block_base.hpp:48
Definition core_iface.hpp:26
Definition power_reference_iface.hpp:23
#define UHD_API
Definition config.h:87
Definition build_info.hpp:12
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
Definition extension.hpp:35
uhd::rfnoc::mb_controller::sptr mb_ctrl
Definition extension.hpp:37
uhd::rfnoc::radio_control::sptr radio_ctrl
Definition extension.hpp:36