6 #ifndef __DDS__Topology__ 7 #define __DDS__Topology__ 21 #include <boost/iterator/filter_iterator.hpp> 49 typedef boost::filter_iterator<TaskInfoCondition_t, HashToTaskInfoMap_t::const_iterator>
TaskInfoIterator_t;
54 typedef boost::filter_iterator<TaskCollectionCondition_t, HashToTaskCollectionMap_t::const_iterator>
73 void init(
const std::string& _fileName,
bool _initForTest =
false);
81 void getDifference(
const CTopology& _topology,
82 HashSet_t& _removedTasks,
83 HashSet_t& _removedCollections,
84 HashSet_t& _addedTasks,
85 HashSet_t& _addedCollections);
87 void setXMLValidationDisabled(
bool _val);
92 TaskPtr_t getTaskByHash(uint64_t _hash)
const;
93 const STaskInfo& getTaskInfoByHash(uint64_t _hash)
const;
95 const std::vector<uint64_t>& getTaskHashesByTaskCollectionHash(uint64_t _hash)
const;
96 TaskPtr_t getTaskByHashPath(
const std::string& _hashPath)
const;
99 const TopoIndexToTopoElementMap_t& getTopoIndexToTopoElementMap()
const;
100 const HashToTaskInfoMap_t& getHashToTaskInfoMap()
const;
101 const HashToTaskCollectionMap_t& getHashToTaskCollectionMap()
const;
102 const HashPathToTaskMap_t& getHashPathToTaskMap()
const;
103 const HashPathToTaskCollectionMap_t& getHashPathToTaskCollectionMap()
const;
106 TaskInfoIteratorPair_t getTaskInfoIterator(
TaskInfoCondition_t _condition =
nullptr)
const;
107 TaskCollectionIteratorPair_t getTaskCollectionIterator(
109 TaskInfoIteratorPair_t getTaskInfoIteratorForPropertyId(
const std::string& _propertyId)
const;
111 std::string stringOfTasks(
const HashSet_t& _ids)
const;
112 std::string stringOfCollections(
const HashSet_t& _ids)
const;
116 virtual std::string toString()
const;
125 void FillHashToTopoElementMap(
const TopoElementPtr_t& _element,
bool _fillHashPathMaps =
false);
127 uint64_t getNextHashForTask(uint64_t _crc)
const;
128 uint64_t getNextHashForTaskCollection(uint64_t _crc)
const;
132 TopoIndexToTopoElementMap_t m_topoIndexToTopoElementMap;
134 HashToTaskCollectionMap_t m_hashToTaskCollectionMap;
135 HashToTaskInfoMap_t m_hashToTaskInfoMap;
136 std::map<std::string, size_t> m_counterMap;
137 std::string m_currentTaskCollectionHashPath;
138 uint64_t m_currentTaskCollectionCrc;
140 CollectionHashToTaskHashesMap_t m_collectionHashToTaskHashesMap;
145 HashPathToTaskMap_t m_hashPathToTaskMap;
146 HashPathToTaskCollectionMap_t m_hashPathToTaskCollectionMap;
148 bool m_bXMLValidationDisabled;
std::string m_taskPath
Definition: Topology.h:39
size_t m_collectionIndex
Definition: Topology.h:38
Definition: TopoIndex.h:16
std::map< uint64_t, STaskInfo > HashToTaskInfoMap_t
Note that hash is of type uint_64. Hash is calculated using CRC64 algorithm.
Definition: Topology.h:47
boost::filter_iterator< TaskCollectionCondition_t, HashToTaskCollectionMap_t::const_iterator > TaskCollectionIterator_t
Definition: Topology.h:55
size_t m_taskIndex
Definition: Topology.h:37
std::pair< TaskCollectionIterator_t, TaskCollectionIterator_t > TaskCollectionIteratorPair_t
Definition: Topology.h:56
std::function< bool(std::pair< uint64_t, const STaskInfo & >)> TaskInfoCondition_t
Definition: Topology.h:48
std::shared_ptr< CTaskCollection > TaskCollectionPtr_t
Definition: TaskCollection.h:47
std::map< CTopoIndex, TopoElementPtr_t, CompareTopoIndexLess > TopoIndexToTopoElementMap_t
Definition: Topology.h:60
Definition: Topology.h:27
std::set< uint64_t > HashSet_t
Definition: Topology.h:63
std::map< uint64_t, TaskCollectionPtr_t > HashToTaskCollectionMap_t
Definition: Topology.h:52
Definition: dds-agent/src/AgentConnectionManager.h:18
std::map< uint64_t, std::vector< uint64_t > > CollectionHashToTaskHashesMap_t
Definition: Topology.h:61
std::function< bool(std::pair< uint64_t, TaskCollectionPtr_t >)> TaskCollectionCondition_t
Definition: Topology.h:53
Definition: Topology.h:42
boost::filter_iterator< TaskInfoCondition_t, HashToTaskInfoMap_t::const_iterator > TaskInfoIterator_t
Definition: Topology.h:49
std::pair< TaskInfoIterator_t, TaskInfoIterator_t > TaskInfoIteratorPair_t
Definition: Topology.h:50
std::shared_ptr< CTask > TaskPtr_t
Definition: dds-topology-lib/src/Task.h:93
std::map< std::string, TaskPtr_t > HashPathToTaskMap_t
Definition: Topology.h:58
TaskPtr_t m_task
Definition: Topology.h:36
std::ostream & operator<<(std::ostream &_out, EAgentCmdType &_agentCmd)
Definition: dds-agent-cmd/src/Options.h:45
std::map< std::string, TaskCollectionPtr_t > HashPathToTaskCollectionMap_t
Definition: Topology.h:59
STaskInfo()
Definition: Topology.h:29
std::shared_ptr< CTaskGroup > TaskGroupPtr_t
Definition: TaskGroup.h:55
std::shared_ptr< CTopoElement > TopoElementPtr_t
Definition: TopoElement.h:42