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

Handle class describing a constant (define) object in description. More...

#include <Objects.h>

Inheritance diagram for dd4hep::Constant:
dd4hep::Handle< ConstantObject >

Public Member Functions

 Constant ()=default
 Default constructor. More...
 
 Constant (const Constant &copy)=default
 Constructor to be used for assignment from a handle. More...
 
template<typename Q >
 Constant (const Handle< Q > &e)
 Constructor to be used when reading the already parsed DOM tree. More...
 
 Constant (const std::string &name)
 Constructor to be used when creating a new DOM tree. More...
 
 Constant (const std::string &name, const std::string &val, const std::string &typ="number")
 Constructor to be used when creating a new DOM tree. More...
 
Constantoperator= (const Constant &copy)=default
 Copy assignment. More...
 
bool operator== (const Constant &rhs) const
 Equality operator. More...
 
std::string dataType () const
 Access the constant. More...
 
std::string toString () const
 String representation of this object. More...
 
- Public Member Functions inherited from dd4hep::Handle< ConstantObject >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< ConstantObject > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< ConstantObject > &element)=default
 Copy constructor. More...
 
 Handle (ConstantObject *element)
 Initializing constructor from pointer. More...
 
 Handle (Q *element)
 Initializing constructor from unrelated pointer with type checking. More...
 
 Handle (const Handle< Q > &element)
 Initializing constructor from unrelated handle with type checking. More...
 
Handle< ConstantObject > & operator= (Handle< ConstantObject > &&element)=default
 Assignment move operator. More...
 
Handle< ConstantObject > & operator= (const Handle< ConstantObject > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< ConstantObject > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< ConstantObject > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< ConstantObject > &element) const
 Boolean operator > used for RB tree insertions. More...
 
bool isValid () const
 Check the validity of the object held by the handle. More...
 
bool operator! () const
 Check the validity of the object held by the handle. More...
 
Handle< ConstantObject > & clear ()
 Release the object held by the handle. More...
 
ConstantObjectoperator-> () const
 Access the held object using the -> operator. More...
 
 operator ConstantObject & () const
 Automatic type conversion to an object references. More...
 
ConstantObjectoperator* () const
 Access the held object using the * operator. More...
 
ConstantObjectptr () const
 Access to the held object. More...
 
Q * _ptr () const
 Access to an unrelated object type. More...
 
Q * data () const
 Access to an unrelated object type. More...
 
Q & object () const
 Access to an unrelated object type. More...
 
ConstantObjectaccess () const
 Checked object access. Throws invalid handle runtime exception if invalid handle. More...
 
const char * name () const
 Access the object name (or "" if not supported by the object) More...
 
const char * name () const
 
const char * name () const
 
void assign (Object *n, const std::string &nam, const std::string &title)
 Assign a new named object. Note: object references must be managed by the user. More...
 
void assign (_Segmentation *s, const std::string &n, const std::string &)
 
void assign (NamedObject *p, const std::string &n, const std::string &t)
 
void destroy ()
 Destroy the underlying object (be careful here: things are not reference counted)! More...
 

Additional Inherited Members

- Public Types inherited from dd4hep::Handle< ConstantObject >
typedef ConstantObject Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< ConstantObjectBase
 Self type: used by sub-classes. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< ConstantObject >
static void bad_assignment (const std::type_info &from, const std::type_info &to)
 Helper routine called when unrelated types are assigned. More...
 
- Public Attributes inherited from dd4hep::Handle< ConstantObject >
ConstantObjectm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Handle class describing a constant (define) object in description.

Constant objects are parsed by the expression evaluator and are subsequently available for expression evaluation.

Author
M.Frank
Version
1.0

Definition at line 209 of file Objects.h.

Constructor & Destructor Documentation

◆ Constant() [1/5]

dd4hep::Constant::Constant ( )
default

Default constructor.

◆ Constant() [2/5]

dd4hep::Constant::Constant ( const Constant copy)
default

Constructor to be used for assignment from a handle.

◆ Constant() [3/5]

template<typename Q >
dd4hep::Constant::Constant ( const Handle< Q > &  e)
inline

Constructor to be used when reading the already parsed DOM tree.

Definition at line 216 of file Objects.h.

◆ Constant() [4/5]

Constant::Constant ( const std::string &  name)

Constructor to be used when creating a new DOM tree.

Definition at line 143 of file Objects.cpp.

◆ Constant() [5/5]

Constant::Constant ( const std::string &  name,
const std::string &  val,
const std::string &  typ = "number" 
)

Constructor to be used when creating a new DOM tree.

Definition at line 138 of file Objects.cpp.

Member Function Documentation

◆ dataType()

std::string Constant::dataType ( ) const

Access the constant.

Definition at line 148 of file Objects.cpp.

◆ operator=()

Constant& dd4hep::Constant::operator= ( const Constant copy)
default

Copy assignment.

◆ operator==()

bool dd4hep::Constant::operator== ( const Constant rhs) const
inline

Equality operator.

Definition at line 224 of file Objects.h.

◆ toString()

std::string Constant::toString ( ) const

String representation of this object.

Definition at line 156 of file Objects.cpp.


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