diff options
Diffstat (limited to 'host/lib/include/uhdlib/transport/adapter.hpp')
-rw-r--r-- | host/lib/include/uhdlib/transport/adapter.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/transport/adapter.hpp b/host/lib/include/uhdlib/transport/adapter.hpp new file mode 100644 index 000000000..3d6d49575 --- /dev/null +++ b/host/lib/include/uhdlib/transport/adapter.hpp @@ -0,0 +1,33 @@ +// +// Copyright 2019 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_UHDLIB_TRANSPORT_ADAPTER_HPP +#define INCLUDED_UHDLIB_TRANSPORT_ADAPTER_HPP + +#include <uhdlib/transport/adapter_info.hpp> +#include <uhdlib/transport/udp_boost_asio_link.hpp> + +namespace uhd { namespace transport { + +class adapter_ctx : uhd::noncopyable +{ +public: + UHD_SINGLETON_FCN(adapter_ctx, get); + + ~adapter_ctx() = default; + + adapter_id_t register_adapter(adapter_info& info); + +private: + adapter_ctx() = default; + + std::mutex _mutex; + std::unordered_map<std::string, adapter_id_t> _id_map; +}; + +}} // namespace uhd::transport + +#endif /* INCLUDED_UHDLIB_TRANSPORT_ADAPTER_HPP */ |