aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/epid_allocator.cpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2019-05-31 14:55:59 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:21 -0800
commitde9cbe9c7c0a6e9296c561423d3b568bc1513133 (patch)
tree4ad7f19e6a33d409afe163aef3b4844442b094a8 /host/lib/rfnoc/epid_allocator.cpp
parentfff4fd59b7b7995904ecb2b010f05f78e9d0a0de (diff)
downloaduhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.tar.gz
uhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.tar.bz2
uhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.zip
rfnoc: Graph and link stream manager API cleanup
Diffstat (limited to 'host/lib/rfnoc/epid_allocator.cpp')
-rw-r--r--host/lib/rfnoc/epid_allocator.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/rfnoc/epid_allocator.cpp b/host/lib/rfnoc/epid_allocator.cpp
index 984b1716e..97a30dc64 100644
--- a/host/lib/rfnoc/epid_allocator.cpp
+++ b/host/lib/rfnoc/epid_allocator.cpp
@@ -27,7 +27,19 @@ sep_id_t epid_allocator::allocate_epid(const sep_addr_t& addr)
}
}
-sep_addr_t epid_allocator::lookup_epid(const sep_id_t& epid) const
+sep_id_t epid_allocator::get_epid(const sep_addr_t& addr)
+{
+ std::lock_guard<std::mutex> lock(_mutex);
+
+ if (_epid_map.count(addr) != 0) {
+ return _epid_map.at(addr);
+ } else {
+ throw uhd::lookup_error(
+ "An EPID has not been allocated for the requested endpoint");
+ }
+}
+
+sep_addr_t epid_allocator::lookup_addr(const sep_id_t& epid) const
{
std::lock_guard<std::mutex> lock(_mutex);