USRP Hardware Driver and USRP Manual: block_controller_factory_python.hpp Source File

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

Loading...
Searching...
No Matches
block_controller_factory_python.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 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/rfnoc/noc_block_base.hpp>
10
11namespace uhd { namespace rfnoc {
12
13// Static factory for constructing a block controller T given an instance of
14// the superclass noc_block_base for the block controller, as might be
15// returned from uhd::rfnoc::graph::get_block(). The instance is downcast to
16// the derived class and returned to the client as a T::sptr. If block_base
17// does not represent an instance of T, nullptr is returned.
18template <typename T>
19 class block_controller_factory
20{
21public:
22 static typename T::sptr make_from(uhd::rfnoc::noc_block_base::sptr block_base)
23 {
24 return std::dynamic_pointer_cast<T>(block_base);
25 }
26};
27
28}} // namespace uhd::rfnoc
uhd::rfnoc::block_controller_factory
Definition block_controller_factory_python.hpp:20
uhd::rfnoc::block_controller_factory::make_from
static T::sptr make_from(uhd::rfnoc::noc_block_base::sptr block_base)
Definition block_controller_factory_python.hpp:22
uhd::rfnoc::noc_block_base::sptr
std::shared_ptr< noc_block_base > sptr
Definition noc_block_base.hpp:48
uhd::rfnoc
Definition actions.hpp:24
uhd
Definition build_info.hpp:12
noc_block_base.hpp