DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
User abstraction class to manipulate JSON elements within a document. More...
#include <Elements.h>
Public Types | |
typedef Handle_t::Elt_t | Elt_t |
Simplification type declarations. More... | |
Public Member Functions | |
Element (const Handle_t &e) | |
Constructor from JsonElement handle. More... | |
Element (const Element &e) | |
Constructor from JsonElement handle. More... | |
Element & | operator= (const Element &c) |
Assignment operator. More... | |
Element & | operator= (Handle_t handle) |
Assignment operator. More... | |
operator bool () const | |
operator bool: check handle validity More... | |
bool | operator! () const |
operator NOT: check handle validity More... | |
operator Handle_t () const | |
Automatic conversion to DOM element handle. More... | |
operator Elt_t () const | |
Automatic conversion to JsonElement pointer. More... | |
Elt_t | ptr () const |
Access to JsonElement pointer. More... | |
std::string | tag () const |
Access the tag name of this element. More... | |
const char * | tagName () const |
Access the tag name of this element. More... | |
std::string | text () const |
Access the tag name of this element. More... | |
bool | hasAttr (const char *name) const |
Check for the existence of a named attribute. More... | |
template<class T > | |
T | attr (const char *tag_value) const |
Access attribute with implicit return type conversion. More... | |
const char * | attr_name (const Attribute a) const |
Access attribute name (throws exception if not present) More... | |
const char * | attr_value (const Attribute a) const |
Access attribute value by the attribute (throws exception if not present) More... | |
size_t | numChildren (const char *tag_value, bool exc=true) const |
Access the number of children of this element with a given tag name. More... | |
std::vector< Attribute > | attributes () const |
Retrieve a collection of all attributes of this element. More... | |
Attribute | getAttr (const char *name) const |
Access single attribute by its name. More... | |
Handle_t | child (const char *tag_value, bool except=true) const |
Access child by tag name. Thow an exception if required in case the child is not present. More... | |
bool | hasChild (const char *tag_value) const |
Check the existence of a child with a given tag name. More... | |
Public Attributes | |
Handle_t | m_element |
The underlying object holding the JsonElement pointer. More... | |
User abstraction class to manipulate JSON elements within a document.
User class encapsulating a DOM element using the Handle_t helper. This is the main class we interact with when analysing the json documents for constructing sub-detectors etc.
Definition at line 358 of file Elements.h.
Simplification type declarations.
Definition at line 361 of file Elements.h.
|
inline |
Constructor from JsonElement handle.
Definition at line 367 of file Elements.h.
|
inline |
Constructor from JsonElement handle.
Definition at line 369 of file Elements.h.
|
inline |
Access attribute with implicit return type conversion.
Definition at line 400 of file Elements.h.
|
inline |
Access attribute name (throws exception if not present)
Definition at line 403 of file Elements.h.
|
inline |
Access attribute value by the attribute (throws exception if not present)
Definition at line 406 of file Elements.h.
|
inline |
Retrieve a collection of all attributes of this element.
Definition at line 412 of file Elements.h.
|
inline |
Access child by tag name. Thow an exception if required in case the child is not present.
Definition at line 417 of file Elements.h.
Attribute Element::getAttr | ( | const char * | name | ) | const |
Access single attribute by its name.
Definition at line 378 of file Elements.cpp.
|
inline |
Check for the existence of a named attribute.
Definition at line 398 of file Elements.h.
|
inline |
Check the existence of a child with a given tag name.
Definition at line 420 of file Elements.h.
|
inline |
Access the number of children of this element with a given tag name.
Definition at line 409 of file Elements.h.
|
inline |
operator bool: check handle validity
Definition at line 382 of file Elements.h.
|
inline |
Automatic conversion to JsonElement pointer.
Definition at line 388 of file Elements.h.
|
inline |
Automatic conversion to DOM element handle.
Definition at line 386 of file Elements.h.
|
inline |
operator NOT: check handle validity
Definition at line 384 of file Elements.h.
Assignment operator.
Definition at line 372 of file Elements.h.
Assignment operator.
Definition at line 377 of file Elements.h.
|
inline |
Access to JsonElement pointer.
Definition at line 390 of file Elements.h.
|
inline |
Access the tag name of this element.
Definition at line 392 of file Elements.h.
|
inline |
Access the tag name of this element.
Definition at line 394 of file Elements.h.
|
inline |
Access the tag name of this element.
Definition at line 396 of file Elements.h.
Handle_t dd4hep::json::Element::m_element |
The underlying object holding the JsonElement pointer.
Definition at line 364 of file Elements.h.