DDS  ver. 3.4
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
dds::topology_api::CTopoBase Class Referenceabstract

#include <TopoBase.h>

Inheritance diagram for dds::topology_api::CTopoBase:
dds::topology_api::CTopoElement dds::topology_api::CTopoProperty dds::topology_api::CTopoRequirement dds::topology_api::CTopoTrigger dds::topology_api::CTopoVars dds::topology_api::CTopoContainer dds::topology_api::CTopoTask dds::topology_api::CTopoCollection dds::topology_api::CTopoGroup

Public Types

enum  EType {
  EType::TOPO_BASE, EType::TOPO_PROPERTY, EType::TOPO_ELEMENT, EType::TASK,
  EType::COLLECTION, EType::GROUP, EType::REQUIREMENT, EType::TOPO_VARS,
  EType::TRIGGER
}
 
using Ptr_t = std::shared_ptr< CTopoBase >
 
using PtrVector_t = std::vector< CTopoBase::Ptr_t >
 

Public Member Functions

void setName (const std::string &_name)
 Modifiers. More...
 
void setParent (CTopoBase *_parent)
 
const std::string & getName () const
 Accessors. More...
 
CTopoBase::EType getType () const
 
CTopoBasegetParent () const
 
std::string getPath () const
 Return full path to topo element or property. More...
 
void initFromXML (const std::string &_filepath, const std::string &_schemaFilepath="", std::string *_topologyName=nullptr)
 Initializes object with data from XML file. More...
 
virtual void initFromPropertyTree (const boost::property_tree::ptree &_pt)=0
 Initialize object with data from property tree. More...
 
virtual void saveToPropertyTree (boost::property_tree::ptree &_pt)=0
 Save object to a property tree. More...
 
virtual std::string toString () const
 Returns string representation of an object. More...
 
virtual std::string hashString () const =0
 Returns string which is used to calculate CRC checksum of the object. More...
 

Static Public Member Functions

template<class Object_t >
static Object_t::Ptr_t make (const std::string &_objectName, const std::string &_filepath, const std::string &_schemaFilepath="", std::string *_topologyName=nullptr)
 Convenience API to create topology object from XML file. More...
 
template<class Object_t >
static Object_t::Ptr_t make (const std::string &_name, const boost::property_tree::ptree &_pt)
 Convenience API to create topology object with data from property tree. More...
 

Protected Member Functions

 CTopoBase (const std::string &_name)
 Constructor. More...
 
virtual ~CTopoBase ()
 Destructor. More...
 
void setType (CTopoBase::EType _type)
 

Friends

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

Member Typedef Documentation

◆ Ptr_t

◆ PtrVector_t

Member Enumeration Documentation

◆ EType

Enumerator
TOPO_BASE 
TOPO_PROPERTY 
TOPO_ELEMENT 
TASK 
COLLECTION 
GROUP 
REQUIREMENT 
TOPO_VARS 
TRIGGER 

Constructor & Destructor Documentation

◆ CTopoBase()

CTopoBase::CTopoBase ( const std::string &  _name)
protected

Constructor.

◆ ~CTopoBase()

CTopoBase::~CTopoBase ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ getName()

const string & CTopoBase::getName ( ) const

Accessors.

◆ getParent()

CTopoBase * CTopoBase::getParent ( ) const

◆ getPath()

string CTopoBase::getPath ( ) const

Return full path to topo element or property.

◆ getType()

CTopoBase::EType CTopoBase::getType ( ) const

◆ hashString()

virtual std::string dds::topology_api::CTopoBase::hashString ( ) const
pure virtual

◆ initFromPropertyTree()

virtual void dds::topology_api::CTopoBase::initFromPropertyTree ( const boost::property_tree::ptree &  _pt)
pure virtual

Initialize object with data from property tree.

Parameters
[in]_nameName of the object as in input file.
[in]_ptProperty tree starting from root.

Implemented in dds::topology_api::CTopoTask, dds::topology_api::CTopoProperty, dds::topology_api::CTopoTrigger, dds::topology_api::CTopoRequirement, dds::topology_api::CTopoCollection, dds::topology_api::CTopoGroup, and dds::topology_api::CTopoVars.

◆ initFromXML()

void CTopoBase::initFromXML ( const std::string &  _filepath,
const std::string &  _schemaFilepath = "",
std::string *  _topologyName = nullptr 
)

Initializes object with data from XML file.

Parameters
[in]_nameName of the object as in input file.
[in]_filepathPath to the topology file.
[in]_schemaFilepathPath to the XSD schema file.
[out]_topologyNameTopology name.
Exceptions
std::runtime_error.

◆ make() [1/2]

template<class Object_t >
static Object_t::Ptr_t dds::topology_api::CTopoBase::make ( const std::string &  _objectName,
const std::string &  _filepath,
const std::string &  _schemaFilepath = "",
std::string *  _topologyName = nullptr 
)
inlinestatic

Convenience API to create topology object from XML file.

Parameters
[in]_nameName of the object as in input file.
[in]_filepathPath to the topology file.
[in]_schemaFilepathPath to the XSD schema file.
[out]_topologyNameTopology name.
Exceptions
std::runtime_error.

◆ make() [2/2]

template<class Object_t >
static Object_t::Ptr_t dds::topology_api::CTopoBase::make ( const std::string &  _name,
const boost::property_tree::ptree &  _pt 
)
inlinestatic

Convenience API to create topology object with data from property tree.

Parameters
[in]_nameName of the object as in input file.
[in]_ptProperty tree starting from root.
Exceptions
std::runtime_error

◆ saveToPropertyTree()

virtual void dds::topology_api::CTopoBase::saveToPropertyTree ( boost::property_tree::ptree &  _pt)
pure virtual

◆ setName()

void CTopoBase::setName ( const std::string &  _name)

Modifiers.

◆ setParent()

void CTopoBase::setParent ( CTopoBase _parent)

◆ setType()

void CTopoBase::setType ( CTopoBase::EType  _type)
protected

◆ toString()

string CTopoBase::toString ( ) const
virtual

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  _strm,
const CTopoBase _element 
)
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: