DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dd4hep::PropertyManager Class Reference

Manager to ease the handling of groups of properties. More...

#include <ComponentProperties.h>

Public Types

typedef std::map< std::string, PropertyProperties
 Property array definition. More...
 

Public Member Functions

 PropertyManager ()
 Default constructor. More...
 
virtual ~PropertyManager ()
 Default destructor. More...
 
size_t size () const
 Access total number of properties. More...
 
bool exists (const std::string &name) const
 Check for existence. More...
 
Propertiesproperties ()
 Access to the property container. More...
 
const Propertiesproperties () const
 Access to the property container. More...
 
const Propertyproperty (const std::string &name) const
 Access property by name (CONST) More...
 
Propertyproperty (const std::string &name)
 Access property by name. More...
 
Propertyoperator[] (const std::string &name)
 Access property by name. More...
 
const Propertyoperator[] (const std::string &name) const
 Access property by name. More...
 
void add (const std::string &name, const Property &property)
 Add a new property. More...
 
template<typename T >
void add (const std::string &name, T &value)
 Add a new property. More...
 
template<typename FUNCTOR >
void for_each (FUNCTOR &func)
 Apply functor on properties. More...
 
template<typename FUNCTOR >
void for_each (const FUNCTOR &func)
 Apply functor on properties. More...
 
void adopt (const PropertyManager &copy)
 Import properties of another instance. More...
 
void dump () const
 Dump string values. More...
 

Protected Member Functions

void verifyNonExistence (const std::string &name) const
 Verify that this property does not exist (throw exception if the name was found) More...
 
Properties::iterator verifyExistence (const std::string &name)
 Verify that this property exists (throw exception if the name was not found) More...
 
Properties::const_iterator verifyExistence (const std::string &name) const
 Verify that this property exists (throw exception if the name was not found) More...
 

Protected Attributes

Properties m_properties
 Property array/map. More...
 

Detailed Description

Manager to ease the handling of groups of properties.

Note: This class cannot be saved to a ROOT file!

Author
M.Frank
Version
1.0

Definition at line 174 of file ComponentProperties.h.

Member Typedef Documentation

◆ Properties

typedef std::map<std::string, Property> dd4hep::PropertyManager::Properties

Property array definition.

Definition at line 177 of file ComponentProperties.h.

Constructor & Destructor Documentation

◆ PropertyManager()

PropertyManager::PropertyManager ( )

Default constructor.

Definition at line 83 of file ComponentProperties.cpp.

◆ ~PropertyManager()

PropertyManager::~PropertyManager ( )
virtual

Default destructor.

Definition at line 87 of file ComponentProperties.cpp.

Member Function Documentation

◆ add() [1/2]

void PropertyManager::add ( const std::string &  name,
const Property property 
)

Add a new property.

Definition at line 154 of file ComponentProperties.cpp.

◆ add() [2/2]

template<typename T >
void dd4hep::PropertyManager::add ( const std::string &  name,
T &  value 
)
inline

Add a new property.

Definition at line 213 of file ComponentProperties.h.

◆ adopt()

void PropertyManager::adopt ( const PropertyManager copy)

Import properties of another instance.

Definition at line 97 of file ComponentProperties.cpp.

◆ dump()

void PropertyManager::dump ( ) const

Dump string values.

Definition at line 160 of file ComponentProperties.cpp.

◆ exists()

bool PropertyManager::exists ( const std::string &  name) const

Check for existence.

Definition at line 102 of file ComponentProperties.cpp.

◆ for_each() [1/2]

template<typename FUNCTOR >
void dd4hep::PropertyManager::for_each ( const FUNCTOR &  func)
inline

Apply functor on properties.

Definition at line 221 of file ComponentProperties.h.

◆ for_each() [2/2]

template<typename FUNCTOR >
void dd4hep::PropertyManager::for_each ( FUNCTOR &  func)
inline

Apply functor on properties.

Definition at line 217 of file ComponentProperties.h.

◆ operator[]() [1/2]

Property & PropertyManager::operator[] ( const std::string &  name)

Access property by name.

Definition at line 144 of file ComponentProperties.cpp.

◆ operator[]() [2/2]

const Property & PropertyManager::operator[] ( const std::string &  name) const

Access property by name.

Definition at line 149 of file ComponentProperties.cpp.

◆ properties() [1/2]

Properties& dd4hep::PropertyManager::properties ( )
inline

Access to the property container.

Definition at line 199 of file ComponentProperties.h.

◆ properties() [2/2]

const Properties& dd4hep::PropertyManager::properties ( ) const
inline

Access to the property container.

Definition at line 201 of file ComponentProperties.h.

◆ property() [1/2]

Property & PropertyManager::property ( const std::string &  name)

Access property by name.

Access property by name (CONST)

Definition at line 134 of file ComponentProperties.cpp.

◆ property() [2/2]

const Property & PropertyManager::property ( const std::string &  name) const

Access property by name (CONST)

Access property by name.

Definition at line 139 of file ComponentProperties.cpp.

◆ size()

size_t PropertyManager::size ( ) const

Access total number of properties.

Definition at line 92 of file ComponentProperties.cpp.

◆ verifyExistence() [1/2]

PropertyManager::Properties::iterator PropertyManager::verifyExistence ( const std::string &  name)
protected

Verify that this property exists (throw exception if the name was not found)

Definition at line 126 of file ComponentProperties.cpp.

◆ verifyExistence() [2/2]

PropertyManager::Properties::const_iterator PropertyManager::verifyExistence ( const std::string &  name) const
protected

Verify that this property exists (throw exception if the name was not found)

Definition at line 117 of file ComponentProperties.cpp.

◆ verifyNonExistence()

void PropertyManager::verifyNonExistence ( const std::string &  name) const
protected

Verify that this property does not exist (throw exception if the name was found)

Definition at line 108 of file ComponentProperties.cpp.

Member Data Documentation

◆ m_properties

Properties dd4hep::PropertyManager::m_properties
protected

Property array/map.

Definition at line 180 of file ComponentProperties.h.


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