Loading...
Searching...
No Matches
block_controller_factory_python.hpp
Go to the documentation of this file.
//
// Copyright 2020 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/rfnoc/noc_block_base.hpp>
namespace uhd { namespace rfnoc {
// Static factory for constructing a block controller T given an instance of
// the superclass noc_block_base for the block controller, as might be
// returned from uhd::rfnoc::graph::get_block(). The instance is downcast to
// the derived class and returned to the client as a T::sptr. If block_base
// does not represent an instance of T, nullptr is returned.
template <typename T>
class block_controller_factory
{
public:
static typename T::sptr make_from(uhd::rfnoc::noc_block_base::sptr block_base)
{
return std::dynamic_pointer_cast<T>(block_base);
}
};
}} // 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