6 #ifndef __DDS__Topology__ 7 #define __DDS__Topology__ 23 namespace topology_api
36 using Ptr_t = std::shared_ptr<CTopoCore>;
47 void init(
const std::string& _fileName);
51 void init(
const std::string& _fileName,
const std::string& _schemaFileName);
55 void init(std::istream& _stream);
59 void init(std::istream& _stream,
const std::string& _schemaFileName);
103 const std::string& _propertyName,
Id_t _taskId)
const;
105 const std::string& _pathPattern)
const;
107 const std::string& _pathPattern)
const;
120 virtual std::string
toString()
const;
130 uint32_t CalculateHash(std::istream& _stream);
131 Id_t calculateId(
const std::string& _idPath,
const std::string& _hashString);
137 m_idToRuntimeCollectionMap;
140 std::map<std::string, size_t> m_counterMap;
142 std::string m_currentCollectionIdPath;
143 Id_t m_currentCollectionId{ 0 };
145 bool m_bXMLValidationDisabled{
false };
147 uint32_t m_hash{ 0 };
148 std::string m_filepath;
CTopoGroup::Ptr_t getMainGroup() const
Definition: TopoCore.cpp:37
virtual std::string toString() const
Returns string representation of an object.
Definition: TopoCore.cpp:537
const STopoRuntimeCollection & getRuntimeCollection(const std::string &_path) const
Returns runtime collection by either ID or runtime path.
Definition: TopoCore.cpp:266
const STopoRuntimeCollection & getRuntimeCollectionByIdPath(const std::string &_idPath) const
Returns runtime collection by runtime path.
Definition: TopoCore.cpp:242
const IdPathToIdMap_t & getTaskIdPathToIdMap() const
Definition: TopoCore.cpp:208
std::string getName() const
Accessors.
Definition: TopoCore.cpp:147
virtual ~CTopoCore()
Destructor.
Definition: TopoCore.cpp:33
std::map< std::string, Id_t > IdPathToIdMap_t
Task/Collection ID path to Task/Collection ID map.
Definition: TopoCore.h:33
const STopoRuntimeTask::Map_t & getIdToRuntimeTaskMap() const
Accessors to internal data structures. Used for unit tests.
Definition: TopoCore.cpp:198
const STopoRuntimeTask & getRuntimeTask(const std::string &_path) const
Returns runtime task by either ID or runtime path.
Definition: TopoCore.cpp:250
STopoRuntimeCollection::FilterIteratorPair_t getRuntimeCollectionIterator(STopoRuntimeCollection::Condition_t _condition=nullptr) const
Definition: TopoCore.cpp:300
std::map< Id_t, STopoRuntimeCollection > Map_t
Definition: TopoCollection.h:59
const IdPathToIdMap_t & getCollectionIdPathToIdMap() const
Definition: TopoCore.cpp:213
std::pair< STopoRuntimeCollection::FilterIterator_t, STopoRuntimeCollection::FilterIterator_t > FilterIteratorPair_t
Definition: TopoCollection.h:65
std::shared_ptr< CTopoGroup > Ptr_t
Definition: TopoGroup.h:18
STopoRuntimeTask::FilterIteratorPair_t getRuntimeTaskIterator(const STopoRuntimeTask::Map_t &_map, STopoRuntimeTask::Condition_t _condition) const
Iterators.
Definition: TopoCore.cpp:282
std::pair< size_t, size_t > getRequiredNofAgents(size_t _defaultNumSlots) const
Definition: TopoCore.cpp:175
uint64_t Id_t
Definition: TopoDef.h:15
const STopoRuntimeTask & getRuntimeTaskById(Id_t _id) const
Returns runtime task by ID.
Definition: TopoCore.cpp:218
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
friend std::ostream & operator<<(std::ostream &_strm, const CTopoCore &_topology)
Operator << for convenient output to ostream.
const STopoRuntimeCollection::Map_t & getIdToRuntimeCollectionMap() const
Definition: TopoCore.cpp:203
std::shared_ptr< CTopoElement > Ptr_t
Definition: TopoElement.h:21
uint32_t getHash() const
Definition: TopoCore.cpp:161
Definition: TopoCore.h:25
STopoRuntimeTask::FilterIteratorPair_t getRuntimeTaskIteratorMatchingPath(const std::string &_pathPattern) const
Definition: TopoCore.cpp:364
CTopoCore()
Constructor.
Definition: TopoCore.cpp:29
std::string getFilepath() const
Definition: TopoCore.cpp:156
void setXMLValidationDisabled(bool _val)
Definition: TopoCore.cpp:170
size_t getTotalNofTasks() const
Definition: TopoCore.cpp:193
void getDifference(const CTopoCore &_topology, IdSet_t &_removedTasks, IdSet_t &_removedCollections, IdSet_t &_addedTasks, IdSet_t &_addedCollections)
Get difference between THIS topology and a new one.
Definition: TopoCore.cpp:104
std::string stringOfCollections(const IdSet_t &_ids) const
Definition: TopoCore.cpp:509
void init(const std::string &_fileName)
Initializes topology from specified file.
Definition: TopoCore.cpp:42
std::shared_ptr< CTopoCore > Ptr_t
std::shared_ptr
Definition: TopoCore.h:36
std::function< bool(std::pair< Id_t, const STopoRuntimeCollection & >)> Condition_t
Definition: TopoCollection.h:60
const STopoRuntimeTask & getRuntimeTaskByIdPath(const std::string &_idPath) const
Returns runtime task by runtime path.
Definition: TopoCore.cpp:234
Definition: TopoCollection.h:57
STopoRuntimeTask::FilterIteratorPair_t getRuntimeTaskIteratorForPropertyName(const std::string &_propertyName, Id_t _taskId) const
Definition: TopoCore.cpp:315
STopoRuntimeCollection::FilterIteratorPair_t getRuntimeCollectionIteratorMatchingPath(const std::string &_pathPattern) const
Definition: TopoCore.cpp:373
std::set< Id_t > IdSet_t
Note that ID is of type uint_64. ID is calculated using CRC64 algorithm.
Definition: TopoCore.h:30
std::string stringOfTasks(const IdSet_t &_ids) const
Definition: TopoCore.cpp:486
const STopoRuntimeCollection & getRuntimeCollectionById(Id_t _id) const
Returns runtime collection by ID.
Definition: TopoCore.cpp:226