DDS  ver. 2.0
Public Types | Public Member Functions | Friends | List of all members
dds::topology_api::CTopology Class Reference

#include <Topology.h>

Public Types

typedef std::map< uint64_t, STaskInfoHashToTaskInfoMap_t
 Note that hash is of type uint_64. Hash is calculated using CRC64 algorithm. More...
 
typedef std::function< bool(std::pair< uint64_t, const STaskInfo & >)> TaskInfoCondition_t
 
typedef boost::filter_iterator< TaskInfoCondition_t, HashToTaskInfoMap_t::const_iterator > TaskInfoIterator_t
 
typedef std::pair< TaskInfoIterator_t, TaskInfoIterator_tTaskInfoIteratorPair_t
 
typedef std::map< uint64_t, TaskCollectionPtr_tHashToTaskCollectionMap_t
 
typedef std::function< bool(std::pair< uint64_t, TaskCollectionPtr_t >)> TaskCollectionCondition_t
 
typedef boost::filter_iterator< TaskCollectionCondition_t, HashToTaskCollectionMap_t::const_iterator > TaskCollectionIterator_t
 
typedef std::pair< TaskCollectionIterator_t, TaskCollectionIterator_tTaskCollectionIteratorPair_t
 
typedef std::map< std::string, TaskPtr_tHashPathToTaskMap_t
 
typedef std::map< std::string, TaskCollectionPtr_tHashPathToTaskCollectionMap_t
 
typedef std::map< CTopoIndex, TopoElementPtr_t, CompareTopoIndexLessTopoIndexToTopoElementMap_t
 
typedef std::map< uint64_t, std::vector< uint64_t > > CollectionHashToTaskHashesMap_t
 
typedef std::set< uint64_t > HashSet_t
 

Public Member Functions

 CTopology ()
 Constructor. More...
 
virtual ~CTopology ()
 Destructor. More...
 
void init (const std::string &_fileName, bool _initForTest=false)
 Initializes topology from specified file. More...
 
void getDifference (const CTopology &_topology, HashSet_t &_removedTasks, HashSet_t &_removedCollections, HashSet_t &_addedTasks, HashSet_t &_addedCollections)
 Get difference between THIS topology and a new one. More...
 
void setXMLValidationDisabled (bool _val)
 
TaskGroupPtr_t getMainGroup () const
 Accessors. More...
 
TopoElementPtr_t getTopoElementByTopoIndex (const CTopoIndex &_index) const
 
TaskPtr_t getTaskByHash (uint64_t _hash) const
 
const STaskInfogetTaskInfoByHash (uint64_t _hash) const
 
TaskCollectionPtr_t getTaskCollectionByHash (uint64_t _hash) const
 
const std::vector< uint64_t > & getTaskHashesByTaskCollectionHash (uint64_t _hash) const
 
TaskPtr_t getTaskByHashPath (const std::string &_hashPath) const
 
const TopoIndexToTopoElementMap_tgetTopoIndexToTopoElementMap () const
 Accessors to internal data structures. Used for unit tests. More...
 
const HashToTaskInfoMap_tgetHashToTaskInfoMap () const
 
const HashToTaskCollectionMap_tgetHashToTaskCollectionMap () const
 
const HashPathToTaskMap_tgetHashPathToTaskMap () const
 
const HashPathToTaskCollectionMap_tgetHashPathToTaskCollectionMap () const
 
TaskInfoIteratorPair_t getTaskInfoIterator (TaskInfoCondition_t _condition=nullptr) const
 Iterators. More...
 
TaskCollectionIteratorPair_t getTaskCollectionIterator (TaskCollectionCondition_t _condition=nullptr) const
 
TaskInfoIteratorPair_t getTaskInfoIteratorForPropertyId (const std::string &_propertyId) const
 
std::string stringOfTasks (const HashSet_t &_ids) const
 
std::string stringOfCollections (const HashSet_t &_ids) const
 
virtual std::string toString () const
 Returns string representation of an object. More...
 

Friends

std::ostream & operator<< (std::ostream &_strm, const CTopology &_topology)
 Operator << for convenient output to ostream. More...
 

Member Typedef Documentation

◆ CollectionHashToTaskHashesMap_t

typedef std::map<uint64_t, std::vector<uint64_t> > dds::topology_api::CTopology::CollectionHashToTaskHashesMap_t

◆ HashPathToTaskCollectionMap_t

◆ HashPathToTaskMap_t

◆ HashSet_t

typedef std::set<uint64_t> dds::topology_api::CTopology::HashSet_t

◆ HashToTaskCollectionMap_t

◆ HashToTaskInfoMap_t

Note that hash is of type uint_64. Hash is calculated using CRC64 algorithm.

◆ TaskCollectionCondition_t

typedef std::function<bool(std::pair<uint64_t, TaskCollectionPtr_t>)> dds::topology_api::CTopology::TaskCollectionCondition_t

◆ TaskCollectionIterator_t

typedef boost::filter_iterator<TaskCollectionCondition_t, HashToTaskCollectionMap_t::const_iterator> dds::topology_api::CTopology::TaskCollectionIterator_t

◆ TaskCollectionIteratorPair_t

◆ TaskInfoCondition_t

typedef std::function<bool(std::pair<uint64_t, const STaskInfo&>)> dds::topology_api::CTopology::TaskInfoCondition_t

◆ TaskInfoIterator_t

typedef boost::filter_iterator<TaskInfoCondition_t, HashToTaskInfoMap_t::const_iterator> dds::topology_api::CTopology::TaskInfoIterator_t

◆ TaskInfoIteratorPair_t

◆ TopoIndexToTopoElementMap_t

Constructor & Destructor Documentation

◆ CTopology()

CTopology::CTopology ( )

Constructor.

◆ ~CTopology()

CTopology::~CTopology ( )
virtual

Destructor.

Member Function Documentation

◆ getDifference()

void CTopology::getDifference ( const CTopology _topology,
HashSet_t _removedTasks,
HashSet_t _removedCollections,
HashSet_t _addedTasks,
HashSet_t _addedCollections 
)

Get difference between THIS topology and a new one.

Parameters
[in]_topologyNew topology to calculate the difference with.
[out]_removedTasksTasks which exist in THIS topology and don't exist in new one.
[out]_removedCollectionsCollections which exist in THIS topology and don't exist in new one.
[out]_addedTasksTasks which exist in new topology and don't exist in THIS one.
[out]_addedCollectionsCollections which exist in new topology and don't exist in THIS one.

◆ getHashPathToTaskCollectionMap()

const CTopology::HashPathToTaskCollectionMap_t & CTopology::getHashPathToTaskCollectionMap ( ) const

◆ getHashPathToTaskMap()

const CTopology::HashPathToTaskMap_t & CTopology::getHashPathToTaskMap ( ) const

◆ getHashToTaskCollectionMap()

const CTopology::HashToTaskCollectionMap_t & CTopology::getHashToTaskCollectionMap ( ) const

◆ getHashToTaskInfoMap()

const CTopology::HashToTaskInfoMap_t & CTopology::getHashToTaskInfoMap ( ) const

◆ getMainGroup()

TaskGroupPtr_t CTopology::getMainGroup ( ) const

Accessors.

◆ getTaskByHash()

TaskPtr_t CTopology::getTaskByHash ( uint64_t  _hash) const

◆ getTaskByHashPath()

TaskPtr_t CTopology::getTaskByHashPath ( const std::string &  _hashPath) const

◆ getTaskCollectionByHash()

TaskCollectionPtr_t CTopology::getTaskCollectionByHash ( uint64_t  _hash) const

◆ getTaskCollectionIterator()

CTopology::TaskCollectionIteratorPair_t CTopology::getTaskCollectionIterator ( TaskCollectionCondition_t  _condition = nullptr) const

◆ getTaskHashesByTaskCollectionHash()

const std::vector< uint64_t > & CTopology::getTaskHashesByTaskCollectionHash ( uint64_t  _hash) const

◆ getTaskInfoByHash()

const STaskInfo & CTopology::getTaskInfoByHash ( uint64_t  _hash) const

◆ getTaskInfoIterator()

CTopology::TaskInfoIteratorPair_t CTopology::getTaskInfoIterator ( TaskInfoCondition_t  _condition = nullptr) const

Iterators.

◆ getTaskInfoIteratorForPropertyId()

CTopology::TaskInfoIteratorPair_t CTopology::getTaskInfoIteratorForPropertyId ( const std::string &  _propertyId) const

◆ getTopoElementByTopoIndex()

TopoElementPtr_t CTopology::getTopoElementByTopoIndex ( const CTopoIndex _index) const

◆ getTopoIndexToTopoElementMap()

const CTopology::TopoIndexToTopoElementMap_t & CTopology::getTopoIndexToTopoElementMap ( ) const

Accessors to internal data structures. Used for unit tests.

◆ init()

void CTopology::init ( const std::string &  _fileName,
bool  _initForTest = false 
)

Initializes topology from specified file.

Exceptions
runtime_error

FIXME Use parser based on the file extension.

◆ setXMLValidationDisabled()

void CTopology::setXMLValidationDisabled ( bool  _val)

◆ stringOfCollections()

std::string CTopology::stringOfCollections ( const HashSet_t _ids) const

◆ stringOfTasks()

std::string CTopology::stringOfTasks ( const HashSet_t _ids) const

◆ toString()

string CTopology::toString ( ) const
virtual

Returns string representation of an object.

Returns
String representation of an object.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  _strm,
const CTopology _topology 
)
friend

Operator << for convenient output to ostream.

Returns
Insertion stream in order to be able to call a succession of insertion operations.

The documentation for this class was generated from the following files: