mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-14 00:56:47 +00:00
SDK: update DDSTopology::GetTasks()
This commit is contained in:
parent
264a178424
commit
50dacbcdde
|
@ -64,30 +64,16 @@ auto DDSTopology::GetNumRequiredAgents() const -> int
|
||||||
return fImpl->fTopo.getRequiredNofAgents();
|
return fImpl->fTopo.getRequiredNofAgents();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto DDSTopology::GetTasks() const -> std::vector<DDSTask>
|
auto DDSTopology::GetTasks(const std::string& path /* = "" */) const -> std::vector<DDSTask>
|
||||||
{
|
|
||||||
std::vector<DDSTask> list;
|
|
||||||
list.reserve(GetNumRequiredAgents());
|
|
||||||
|
|
||||||
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;
|
std::vector<DDSTask> list;
|
||||||
|
|
||||||
auto itPair = fImpl->fTopo.getRuntimeTaskIteratorMatchingPath(path);
|
dds::topology_api::STopoRuntimeTask::FilterIteratorPair_t itPair;
|
||||||
|
if (path == "") {
|
||||||
|
itPair = fImpl->fTopo.getRuntimeTaskIterator(nullptr); // passing nullptr will get all tasks
|
||||||
|
} else {
|
||||||
|
itPair = fImpl->fTopo.getRuntimeTaskIteratorMatchingPath(path);
|
||||||
|
}
|
||||||
auto tasks = boost::make_iterator_range(itPair.first, itPair.second);
|
auto tasks = boost::make_iterator_range(itPair.first, itPair.second);
|
||||||
|
|
||||||
for (const auto& task : tasks) {
|
for (const auto& task : tasks) {
|
||||||
|
|
|
@ -53,11 +53,8 @@ class DDSTopology
|
||||||
/// @brief Get number of required agents for this topology
|
/// @brief Get number of required agents for this topology
|
||||||
auto GetNumRequiredAgents() const -> int;
|
auto GetNumRequiredAgents() const -> int;
|
||||||
|
|
||||||
/// @brief Get list of tasks in this topology
|
/// @brief Get list of tasks in this topology, optionally matching provided path
|
||||||
auto GetTasks() const -> std::vector<DDSTask>;
|
auto GetTasks(const std::string& = "") 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
|
/// @brief Get list of tasks in this topology
|
||||||
auto GetCollections() const -> std::vector<DDSCollection>;
|
auto GetCollections() const -> std::vector<DDSCollection>;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user