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

The property class to assign options to actions. More...

#include <ComponentProperties.h>

Inheritance diagram for dd4hep::Property:
dd4hep::PropertyValue< TYPE >

Public Member Functions

 Property ()=default
 Default constructor. More...
 
 Property (const Property &p)=default
 Copy constructor. More...
 
template<typename TYPE >
 Property (TYPE &val)
 User constructor. More...
 
void * ptr () const
 Access void data pointer. More...
 
std::string type () const
 Property type name. More...
 
const BasicGrammargrammar () const
 Access grammar object. More...
 
std::string str () const
 Conversion to string value. More...
 
Propertystr (const std::string &input)
 Conversion from string value. More...
 
const Propertystr (const std::string &input) const
 Conversion from string value. More...
 
Propertyoperator= (const Property &p)=default
 Assignment operator. More...
 
Propertyoperator= (const char *val)
 Assignment operator / set new balue. More...
 
template<typename TYPE >
Propertyoperator= (const TYPE &val)
 Assignment operator / set new balue. More...
 
template<typename TYPE >
TYPE value () const
 Retrieve value. More...
 
template<typename TYPE >
void value (TYPE &value) const
 Retrieve value from stack (large values e.g. vectors etc.) More...
 
template<typename TYPE >
void set (const TYPE &value)
 Set value of this property. More...
 

Static Public Member Functions

static std::string type (const Property &proptery)
 Property type name. More...
 
static std::string type (const std::type_info &proptery)
 Property type name. More...
 

Protected Attributes

void * m_par { nullptr }
 Pointer to the data location. More...
 
const BasicGrammarm_hdl { nullptr }
 Reference to the grammar of this property (extended type description) More...
 

Detailed Description

The property class to assign options to actions.

Standard implementation of a property mechanism. The data conversion mechanism between various properties uses internally boost::spirit to allow also conversions between types, which are initially unrelated such as e.g. vector<int> and list<short>.

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

Author
M.Frank
Version
1.0

Definition at line 48 of file ComponentProperties.h.

Constructor & Destructor Documentation

◆ Property() [1/3]

dd4hep::Property::Property ( )
default

Default constructor.

◆ Property() [2/3]

dd4hep::Property::Property ( const Property p)
default

Copy constructor.

◆ Property() [3/3]

template<typename TYPE >
dd4hep::Property::Property ( TYPE &  val)

User constructor.

Definition at line 95 of file ComponentProperties.h.

Member Function Documentation

◆ grammar()

const BasicGrammar & Property::grammar ( ) const

Access grammar object.

Definition at line 41 of file ComponentProperties.cpp.

◆ operator=() [1/3]

Property & Property::operator= ( const char *  val)

Assignment operator / set new balue.

Definition at line 74 of file ComponentProperties.cpp.

◆ operator=() [2/3]

Property& dd4hep::Property::operator= ( const Property p)
default

Assignment operator.

◆ operator=() [3/3]

template<typename TYPE >
Property & dd4hep::Property::operator= ( const TYPE &  val)

Assignment operator / set new balue.

Assignment operator / set new balue

Definition at line 111 of file ComponentProperties.h.

◆ ptr()

void* dd4hep::Property::ptr ( ) const
inline

Access void data pointer.

Definition at line 67 of file ComponentProperties.h.

◆ set()

template<typename TYPE >
void dd4hep::Property::set ( const TYPE &  value)

Set value of this property.

Definition at line 102 of file ComponentProperties.h.

◆ str() [1/3]

std::string Property::str ( ) const

Conversion to string value.

Definition at line 48 of file ComponentProperties.cpp.

◆ str() [2/3]

Property & Property::str ( const std::string &  input)

Conversion from string value.

Definition at line 65 of file ComponentProperties.cpp.

◆ str() [3/3]

const Property & Property::str ( const std::string &  input) const

Conversion from string value.

Definition at line 56 of file ComponentProperties.cpp.

◆ type() [1/3]

std::string Property::type ( ) const

Property type name.

Definition at line 37 of file ComponentProperties.cpp.

◆ type() [2/3]

std::string Property::type ( const Property proptery)
static

Property type name.

Definition at line 27 of file ComponentProperties.cpp.

◆ type() [3/3]

std::string Property::type ( const std::type_info &  proptery)
static

Property type name.

Definition at line 32 of file ComponentProperties.cpp.

◆ value() [1/2]

template<typename TYPE >
TYPE dd4hep::Property::value

Retrieve value.

Definition at line 126 of file ComponentProperties.h.

◆ value() [2/2]

template<typename TYPE >
void dd4hep::Property::value ( TYPE &  value) const

Retrieve value from stack (large values e.g. vectors etc.)

Definition at line 117 of file ComponentProperties.h.

Member Data Documentation

◆ m_hdl

const BasicGrammar* dd4hep::Property::m_hdl { nullptr }
protected

Reference to the grammar of this property (extended type description)

Definition at line 53 of file ComponentProperties.h.

◆ m_par

void* dd4hep::Property::m_par { nullptr }
protected

Pointer to the data location.

Definition at line 51 of file ComponentProperties.h.


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