diff --git a/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.cpp b/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.cpp index 1be2afd..1f456d1 100644 --- a/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.cpp +++ b/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.cpp @@ -104,3 +104,39 @@ std::vector resource_map_t::get_receiver_ids() const return ids; } + +std::vector resource_map_t::get_sender_ids() const +{ + std::vector ids; + lock_t lock(mutex_); + for(const auto& [id, resources] : map_) + { + for(const auto& resource : resources) + { + if(resource->get_resource_type() == nmos::types::sender) + { + ids.push_back(id); + } + } + } + + return ids; +} + +std::vector resource_map_t::get_receiver_ids() const +{ + std::vector ids; + lock_t lock(mutex_); + for(const auto& [id, resources] : map_) + { + for(const auto& resource : resources) + { + if(resource->get_resource_type() == nmos::types::receiver) + { + ids.push_back(id); + } + } + } + + return ids; +} diff --git a/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.h b/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.h index eaee561..0eed3a4 100644 --- a/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.h +++ b/cpp/libs/ossrf_nmos_api/lib/src/context/resource_map.h @@ -37,7 +37,6 @@ namespace ossrf std::vector get_sender_ids() const; std::vector get_receiver_ids() const; }; - using resource_map_ptr = std::shared_ptr; using resource_map_uptr = std::unique_ptr; } // namespace ossrf