From 01284980b1d7227f1c11496d2be939bb4b23adb1 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Fri, 9 Aug 2019 11:18:35 -0700 Subject: transport: Add modeling of physical adapters Now link instances must have the ability to report the corresponding physical adapter that is used for the local side of the link. This information can be used to help identify when multiple links share the same adapter. --- host/lib/include/uhdlib/transport/adapter.hpp | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 host/lib/include/uhdlib/transport/adapter.hpp (limited to 'host/lib/include/uhdlib/transport/adapter.hpp') 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 +#include + +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 _id_map; +}; + +}} // namespace uhd::transport + +#endif /* INCLUDED_UHDLIB_TRANSPORT_ADAPTER_HPP */ -- cgit v1.2.3