mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
SDK: Add DDSTopology::GetTasksMatchingPath
This commit is contained in:
parent
f42945b3a3
commit
25658370fa
|
@ -69,10 +69,25 @@ auto DDSTopology::GetTasks() const -> std::vector<DDSTask>
|
|||
std::vector<DDSTask> 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<DDSTask>
|
||||
{
|
||||
std::vector<DDSTask> 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<DDSCollection>
|
|||
{
|
||||
std::vector<DDSCollection> 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) {
|
||||
|
|
|
@ -56,6 +56,9 @@ class DDSTopology
|
|||
/// @brief Get list of tasks in this topology
|
||||
auto GetTasks() const -> std::vector<DDSTask>;
|
||||
|
||||
/// @brief Get list of tasks matching the provided topology path
|
||||
auto GetTasksMatchingPath(const std::string&) const -> std::vector<DDSTask>;
|
||||
|
||||
/// @brief Get list of tasks in this topology
|
||||
auto GetCollections() const -> std::vector<DDSCollection>;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user