diff --git a/fairmq/sdk/DDSTopology.cxx b/fairmq/sdk/DDSTopology.cxx index 0a24cd31..4ca2b039 100644 --- a/fairmq/sdk/DDSTopology.cxx +++ b/fairmq/sdk/DDSTopology.cxx @@ -69,10 +69,25 @@ auto DDSTopology::GetTasks() const -> std::vector std::vector list; list.reserve(GetNumRequiredAgents()); - auto itPair = fImpl->fTopo.getRuntimeTaskIterator( - [](const dds::topology_api::STopoRuntimeTask::FilterIterator_t::value_type&) -> bool { - return true; - }); + auto itPair = fImpl->fTopo.getRuntimeTaskIterator(nullptr); // passing nullptr will get all tasks + auto tasks = boost::make_iterator_range(itPair.first, itPair.second); + + for (const auto& task : tasks) { + LOG(debug) << "Found task with id: " << task.first << ", " + << "Path: " << task.second.m_taskPath << ", " + << "Collection id: " << task.second.m_taskCollectionId << ", " + << "Name: " << task.second.m_task->getName() << "_" << task.second.m_taskIndex; + list.emplace_back(task.first, task.second.m_taskCollectionId); + } + + return list; +} + +auto DDSTopology::GetTasksMatchingPath(const std::string& path) const -> std::vector +{ + std::vector list; + + auto itPair = fImpl->fTopo.getRuntimeTaskIteratorMatchingPath(path); auto tasks = boost::make_iterator_range(itPair.first, itPair.second); for (const auto& task : tasks) { @@ -90,10 +105,7 @@ auto DDSTopology::GetCollections() const -> std::vector { std::vector list; - auto itPair = fImpl->fTopo.getRuntimeCollectionIterator( - [](const dds::topology_api::STopoRuntimeCollection::FilterIterator_t::value_type&) -> bool { - return true; - }); + auto itPair = fImpl->fTopo.getRuntimeCollectionIterator(nullptr); // passing nullptr will get all collections auto collections = boost::make_iterator_range(itPair.first, itPair.second); for (const auto& c : collections) { diff --git a/fairmq/sdk/DDSTopology.h b/fairmq/sdk/DDSTopology.h index 284a8576..dcb36e65 100644 --- a/fairmq/sdk/DDSTopology.h +++ b/fairmq/sdk/DDSTopology.h @@ -56,6 +56,9 @@ class DDSTopology /// @brief Get list of tasks in this topology auto GetTasks() const -> std::vector; + /// @brief Get list of tasks matching the provided topology path + auto GetTasksMatchingPath(const std::string&) const -> std::vector; + /// @brief Get list of tasks in this topology auto GetCollections() const -> std::vector;