diff --git a/fairmq/sdk/DDSSession.cxx b/fairmq/sdk/DDSSession.cxx index f5270e59..217e1104 100644 --- a/fairmq/sdk/DDSSession.cxx +++ b/fairmq/sdk/DDSSession.cxx @@ -254,7 +254,7 @@ auto DDSSession::RequestTaskInfo() -> std::vector std::vector taskInfo; taskInfo.reserve(res.size()); for (auto& a : res) { - taskInfo.emplace_back(a.m_taskID); + taskInfo.emplace_back(a.m_taskID, 0); } return taskInfo; diff --git a/fairmq/sdk/DDSTask.h b/fairmq/sdk/DDSTask.h index b3e788f1..d593b212 100644 --- a/fairmq/sdk/DDSTask.h +++ b/fairmq/sdk/DDSTask.h @@ -9,7 +9,7 @@ #ifndef FAIR_MQ_SDK_DDSTASK_H #define FAIR_MQ_SDK_DDSTASK_H -// #include +#include #include #include @@ -27,19 +27,22 @@ class DDSTask public: using Id = std::uint64_t; - explicit DDSTask(Id id) + explicit DDSTask(Id id, Id collectionId) : fId(id) + , fCollectionId(collectionId) {} Id GetId() const { return fId; } + DDSCollection::Id GetCollectionId() const { return fCollectionId; } friend auto operator<<(std::ostream& os, const DDSTask& task) -> std::ostream& { - return os << "DDSTask id: " << task.fId; + return os << "DDSTask id: " << task.fId << ", collection id: " << task.fCollectionId; } private: Id fId; + DDSCollection::Id fCollectionId; }; } // namespace sdk diff --git a/fairmq/sdk/DDSTopology.cxx b/fairmq/sdk/DDSTopology.cxx index 3a8c94e3..f4715f3d 100644 --- a/fairmq/sdk/DDSTopology.cxx +++ b/fairmq/sdk/DDSTopology.cxx @@ -80,10 +80,31 @@ auto DDSTopology::GetTasks() const -> std::vector auto tasks = boost::make_iterator_range(itPair.first, itPair.second); for (const auto& task : tasks) { - LOG(debug) << "Found task " << task.first << ": " + 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); + list.emplace_back(task.first, task.second.m_taskCollectionId); + } + + return list; +} + +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 collections = boost::make_iterator_range(itPair.first, itPair.second); + + for (const auto& c : collections) { + LOG(debug) << "Found collection with id: " << c.first << ", " + << "Index: " << c.second.m_collectionIndex << ", " + << "Path: " << c.second.m_collectionPath; + list.emplace_back(c.first); } return list; diff --git a/fairmq/sdk/DDSTopology.h b/fairmq/sdk/DDSTopology.h index 4687b4d8..fb8b2d31 100644 --- a/fairmq/sdk/DDSTopology.h +++ b/fairmq/sdk/DDSTopology.h @@ -10,6 +10,7 @@ #define FAIR_MQ_SDK_DDSTOPOLOGY_H #include +#include #include #include #include @@ -54,6 +55,9 @@ class DDSTopology /// @brief Get list of tasks in this topology auto GetTasks() const -> std::vector; + /// @brief Get list of tasks in this topology + auto GetCollections() const -> std::vector; + /// @brief Get the name of the topology auto GetName() const -> std::string;