From 0aea0b1029bae55294c70324b5c032bab02e5f00 Mon Sep 17 00:00:00 2001 From: Andrey Lebedev Date: Mon, 13 Jul 2020 19:17:10 +0200 Subject: [PATCH] dds-topology: add STopoRuntimeTask::m_taskId and STopoRuntimeCollection::m_collectionId --- ReleaseNotes.md | 1 + dds-topology-lib/src/TopoCollection.h | 11 +++-------- dds-topology-lib/src/TopoCore.cpp | 2 ++ dds-topology-lib/src/TopoTask.h | 17 +++++------------ 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index b0e64b13..ec02fb2f 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -5,6 +5,7 @@ ### dds-topology Added: new std::istream based APIs. Added: new CTopology::getRuntimeTask and CTopology::getRuntimeCollection methods which take either ID or runtime path as input. +Added: task ID to STopoRuntimeTask and collection ID to STopoRuntimeCollection. ## v3.4 (2020-07-01) diff --git a/dds-topology-lib/src/TopoCollection.h b/dds-topology-lib/src/TopoCollection.h index cdf08a30..b1da8072 100644 --- a/dds-topology-lib/src/TopoCollection.h +++ b/dds-topology-lib/src/TopoCollection.h @@ -64,14 +64,9 @@ namespace dds typedef std::pair FilterIteratorPair_t; - STopoRuntimeCollection() - : m_collection(nullptr) - , m_collectionIndex(0) - , m_collectionPath() - { - } - CTopoCollection::Ptr_t m_collection; - size_t m_collectionIndex; + CTopoCollection::Ptr_t m_collection{ nullptr }; + Id_t m_collectionId{ 0 }; + size_t m_collectionIndex{ 0 }; std::string m_collectionPath; STopoRuntimeTask::Map_t m_idToRuntimeTaskMap; ///< Map of task ID to STopoRuntimeTask }; diff --git a/dds-topology-lib/src/TopoCore.cpp b/dds-topology-lib/src/TopoCore.cpp index 248a9601..c646fdd3 100644 --- a/dds-topology-lib/src/TopoCore.cpp +++ b/dds-topology-lib/src/TopoCore.cpp @@ -411,6 +411,7 @@ void CTopoCore::FillIdToTopoElementMap(const CTopoElement::Ptr_t& _element) STopoRuntimeTask info; info.m_task = task; + info.m_taskId = crc; info.m_taskIndex = index; info.m_collectionIndex = collectionCounter; info.m_taskPath = idPath; @@ -448,6 +449,7 @@ void CTopoCore::FillIdToTopoElementMap(const CTopoElement::Ptr_t& _element) STopoRuntimeCollection info; info.m_collection = collection; + info.m_collectionId = crc; info.m_collectionIndex = index; info.m_collectionPath = m_currentCollectionIdPath; m_idToRuntimeCollectionMap.insert(make_pair(crc, info)); diff --git a/dds-topology-lib/src/TopoTask.h b/dds-topology-lib/src/TopoTask.h index 9357e80a..e65ab7c6 100644 --- a/dds-topology-lib/src/TopoTask.h +++ b/dds-topology-lib/src/TopoTask.h @@ -107,19 +107,12 @@ namespace dds typedef std::pair FilterIteratorPair_t; - STopoRuntimeTask() - : m_task(nullptr) - , m_taskIndex(0) - , m_collectionIndex(std::numeric_limits::max()) - , m_taskPath() - , m_taskCollectionId(0) - { - } - CTopoTask::Ptr_t m_task; - size_t m_taskIndex; - size_t m_collectionIndex; + CTopoTask::Ptr_t m_task{ nullptr }; + Id_t m_taskId{ 0 }; + size_t m_taskIndex{ 0 }; + size_t m_collectionIndex{ std::numeric_limits::max() }; std::string m_taskPath; - Id_t m_taskCollectionId; + Id_t m_taskCollectionId{ 0 }; }; } // namespace topology_api } // namespace dds