From 1ed37cdfda93e430037ee4028ec5ac70ab223b1b Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 24 May 2019 14:46:39 -0700 Subject: rfnoc: Add block registry/factory and make_args - noc_block_base now has a ctor defined - The registry stores factory functions to the individual Noc-Block implementations --- host/lib/include/uhdlib/rfnoc/factory.hpp | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 host/lib/include/uhdlib/rfnoc/factory.hpp (limited to 'host/lib/include/uhdlib/rfnoc') diff --git a/host/lib/include/uhdlib/rfnoc/factory.hpp b/host/lib/include/uhdlib/rfnoc/factory.hpp new file mode 100644 index 000000000..3305dda3e --- /dev/null +++ b/host/lib/include/uhdlib/rfnoc/factory.hpp @@ -0,0 +1,32 @@ +// +// Copyright 2019 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_LIBUHD_RFNOC_FACTORY_HPP +#define INCLUDED_LIBUHD_RFNOC_FACTORY_HPP + +#include +#include + +namespace uhd { namespace rfnoc { + +/*! Container for factory functionality + */ +class factory +{ +public: + /*! Return a factory function for an RFNoC block based on the Noc-ID + * + * \returns a pair: factory function, and block name + * \throws uhd::lookup_error if no block is found + */ + static std::pair + get_block_factory(noc_block_base::noc_id_t noc_id); +}; + + +}} /* namespace uhd::rfnoc */ + +#endif /* INCLUDED_LIBUHD_RFNOC_FACTORY_HPP */ -- cgit v1.2.3