DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Classes | Typedefs | Functions
dd4hep::json Namespace Reference

Namespace for the AIDA detector description toolkit supporting JSON utilities. More...

Classes

class  Collection_t
 Class to support the access to collections of JsonNodes (or JsonElements) More...
 
class  Document
 Class supporting the basic functionality of an JSON document. More...
 
class  DocumentHandler
 Class supporting to read and parse XML documents. More...
 
class  DocumentHolder
 Class supporting the basic functionality of an JSON document including ownership. More...
 
class  Element
 User abstraction class to manipulate JSON elements within a document. More...
 
class  Handle_t
 Class to easily access the properties of single JsonElements. More...
 
class  NodeList
 Class describing a list of JSON nodes. More...
 

Typedefs

typedef char XmlChar
 
typedef boost::property_tree::ptree ptree
 
typedef boost::property_tree::ptree JsonDocument
 
typedef boost::property_tree::ptree::value_type JsonAttr
 
typedef boost::property_tree::ptree::value_type JsonElement
 
typedef const JsonAttrAttribute
 

Functions

std::string _toString (const Attribute attr)
 Convert json attribute to STL string. More...
 
std::string _toString (const char *toTranscode)
 Convert json string to STL string. More...
 
std::string _toString (const std::string &s)
 Do-nothing version. Present for completeness and argument interchangeability. More...
 
std::string _toString (unsigned long i, const char *fmt="%lu")
 Format unsigned long integer to string with arbitrary format. More...
 
std::string _toString (unsigned int i, const char *fmt="%u")
 Format unsigned integer (32 bits) to string with arbitrary format. More...
 
std::string _toString (int i, const char *fmt="%d")
 Format signed integer (32 bits) to string with arbitrary format. More...
 
std::string _toString (long i, const char *fmt="%ld")
 Format signed long integer to string with arbitrary format. More...
 
std::string _toString (float d, const char *fmt="%.17e")
 Format single procision float number (32 bits) to string with arbitrary format. More...
 
std::string _toString (double d, const char *fmt="%.17e")
 Format double procision float number (64 bits) to string with arbitrary format. More...
 
std::string _ptrToString (const void *p, const char *fmt="%p")
 Format void pointer (64 bits) to string with arbitrary format. More...
 
template<typename T >
std::string _toString (const T *p, const char *fmt="%p")
 Format void pointer (64 bits) to string with arbitrary format. More...
 
template<typename T >
void _toDictionary (const char *name, T value)
 Helper function to populate the evaluator dictionary. More...
 
void _toDictionary (const char *name, const char *value)
 Helper function to populate the evaluator dictionary. More...
 
void _toDictionary (const std::string &name, const char *value)
 Helper function to populate the evaluator dictionary. More...
 
void _toDictionary (const char *name, float value)
 Helper function to populate the evaluator dictionary. More...
 
void _toDictionary (const char *name, double value)
 Helper function to populate the evaluator dictionary. More...
 
std::string getEnviron (const std::string &env)
 Helper function to lookup environment from the expression evaluator. More...
 
bool _toBool (const char *value)
 Conversion function from raw unicode string to bool. More...
 
int _toInt (const char *value)
 Conversion function from raw unicode string to int. More...
 
long _toLong (const char *value)
 Conversion function from raw unicode string to long. More...
 
float _toFloat (const char *value)
 Conversion function from raw unicode string to float. More...
 
double _toDouble (const char *value)
 Conversion function from raw unicode string to double. More...
 
template<>
INLINE std::string Handle_t::attr< std::string > (const char *tag_value) const
 
void dumpTree (Handle_t elt)
 
void dumpTree (Element elt)
 
void dumpTree (const JsonElement *elt)
 

Detailed Description

Namespace for the AIDA detector description toolkit supporting JSON utilities.

Typedef Documentation

◆ Attribute

Definition at line 38 of file Elements.h.

◆ JsonAttr

typedef boost::property_tree::ptree::value_type dd4hep::json::JsonAttr

Definition at line 32 of file config.h.

◆ JsonDocument

typedef boost::property_tree::ptree dd4hep::json::JsonDocument

Definition at line 31 of file config.h.

◆ JsonElement

typedef boost::property_tree::ptree::value_type dd4hep::json::JsonElement

Definition at line 33 of file config.h.

◆ ptree

typedef boost::property_tree::ptree dd4hep::json::ptree

Definition at line 30 of file config.h.

◆ XmlChar

typedef char dd4hep::json::XmlChar

Definition at line 29 of file config.h.

Function Documentation

◆ _ptrToString()

std::string dd4hep::json::_ptrToString ( const void *  p,
const char *  fmt = "%p" 
)

Format void pointer (64 bits) to string with arbitrary format.

Format pointer to string with arbitrary format.

Definition at line 137 of file Elements.cpp.

◆ _toBool()

bool dd4hep::json::_toBool ( const char *  value)

Conversion function from raw unicode string to bool.

Definition at line 149 of file Elements.cpp.

◆ _toDictionary() [1/5]

void dd4hep::json::_toDictionary ( const char *  name,
const char *  value 
)

Helper function to populate the evaluator dictionary.

Definition at line 165 of file Elements.cpp.

◆ _toDictionary() [2/5]

template void dd4hep::json::_toDictionary ( const char *  name,
double  value 
)

Helper function to populate the evaluator dictionary.

◆ _toDictionary() [3/5]

template void dd4hep::json::_toDictionary ( const char *  name,
float  value 
)

Helper function to populate the evaluator dictionary.

◆ _toDictionary() [4/5]

template<typename T >
void dd4hep::json::_toDictionary ( const char *  name,
value 
)

Helper function to populate the evaluator dictionary.

Definition at line 169 of file Elements.cpp.

◆ _toDictionary() [5/5]

void dd4hep::json::_toDictionary ( const std::string &  name,
const char *  value 
)
inline

Helper function to populate the evaluator dictionary.

Definition at line 71 of file Elements.h.

◆ _toDouble()

double dd4hep::json::_toDouble ( const char *  value)

Conversion function from raw unicode string to double.

Definition at line 161 of file Elements.cpp.

◆ _toFloat()

float dd4hep::json::_toFloat ( const char *  value)

Conversion function from raw unicode string to float.

Definition at line 157 of file Elements.cpp.

◆ _toInt()

int dd4hep::json::_toInt ( const char *  value)

Conversion function from raw unicode string to int.

Definition at line 145 of file Elements.cpp.

◆ _toLong()

long dd4hep::json::_toLong ( const char *  value)

Conversion function from raw unicode string to long.

Definition at line 141 of file Elements.cpp.

◆ _toString() [1/10]

std::string dd4hep::json::_toString ( const Attribute  attr)

Convert json attribute to STL string.

Definition at line 80 of file Elements.cpp.

◆ _toString() [2/10]

std::string dd4hep::json::_toString ( const char *  toTranscode)

Convert json string to STL string.

Do-nothing version. Present for completeness and argument interchangeability.

Definition at line 93 of file Elements.cpp.

◆ _toString() [3/10]

std::string dd4hep::json::_toString ( const std::string &  s)

Do-nothing version. Present for completeness and argument interchangeability.

Definition at line 100 of file Elements.cpp.

◆ _toString() [4/10]

template<typename T >
std::string dd4hep::json::_toString ( const T *  p,
const char *  fmt = "%p" 
)

Format void pointer (64 bits) to string with arbitrary format.

Definition at line 63 of file Elements.h.

◆ _toString() [5/10]

std::string dd4hep::json::_toString ( double  d,
const char *  fmt = "%.17e" 
)

Format double procision float number (64 bits) to string with arbitrary format.

Definition at line 132 of file Elements.cpp.

◆ _toString() [6/10]

std::string dd4hep::json::_toString ( float  d,
const char *  fmt = "%.17e" 
)

Format single procision float number (32 bits) to string with arbitrary format.

Definition at line 127 of file Elements.cpp.

◆ _toString() [7/10]

std::string dd4hep::json::_toString ( int  i,
const char *  fmt = "%d" 
)

Format signed integer (32 bits) to string with arbitrary format.

Definition at line 117 of file Elements.cpp.

◆ _toString() [8/10]

std::string dd4hep::json::_toString ( long  i,
const char *  fmt = "%ld" 
)

Format signed long integer to string with arbitrary format.

Definition at line 122 of file Elements.cpp.

◆ _toString() [9/10]

std::string dd4hep::json::_toString ( unsigned int  i,
const char *  fmt = "%u" 
)

Format unsigned integer (32 bits) to string with arbitrary format.

Definition at line 112 of file Elements.cpp.

◆ _toString() [10/10]

std::string dd4hep::json::_toString ( unsigned long  i,
const char *  fmt = "%lu" 
)

Format unsigned long integer to string with arbitrary format.

Definition at line 107 of file Elements.cpp.

◆ dumpTree() [1/3]

void dd4hep::json::dumpTree ( const JsonElement elt)

Definition at line 444 of file Elements.cpp.

◆ dumpTree() [2/3]

void dd4hep::json::dumpTree ( Element  elt)

Definition at line 440 of file Elements.cpp.

◆ dumpTree() [3/3]

void dd4hep::json::dumpTree ( Handle_t  elt)

Definition at line 436 of file Elements.cpp.

◆ getEnviron()

std::string dd4hep::json::getEnviron ( const std::string &  env)

Helper function to lookup environment from the expression evaluator.

Evaluate string constant using environment stored in the evaluator.

Definition at line 184 of file Elements.cpp.

◆ Handle_t::attr< std::string >()

template<>
INLINE std::string dd4hep::json::Handle_t::attr< std::string > ( const char *  tag_value) const

Definition at line 229 of file Elements.h.