diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-05-24 14:46:39 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:16 -0800 |
commit | 1ed37cdfda93e430037ee4028ec5ac70ab223b1b (patch) | |
tree | 16c20409cf18b0747b107092ed64c3beab4f6e89 /host/lib/include/uhdlib/rfnoc | |
parent | de6dfccc835ad46b5f4362caae66a37651716ab2 (diff) | |
download | uhd-1ed37cdfda93e430037ee4028ec5ac70ab223b1b.tar.gz uhd-1ed37cdfda93e430037ee4028ec5ac70ab223b1b.tar.bz2 uhd-1ed37cdfda93e430037ee4028ec5ac70ab223b1b.zip |
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
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/factory.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
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 <uhd/rfnoc/registry.hpp> +#include <uhd/rfnoc/noc_block_base.hpp> + +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<registry::factory_t, std::string> + get_block_factory(noc_block_base::noc_id_t noc_id); +}; + + +}} /* namespace uhd::rfnoc */ + +#endif /* INCLUDED_LIBUHD_RFNOC_FACTORY_HPP */ |