DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Helper.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef JSON_HELPER_H
14 #define JSON_HELPER_H
15 
16 // Framework include files
17 #include <JSON/Detector.h>
18 #include <JSON/ChildValue.h>
19 #include <DD4hep/Detector.h>
20 #include <DD4hep/Factories.h>
21 #include <DD4hep/DD4hepUnits.h>
22 
23 // Shortcuts to elements of the JSON namespace
29 typedef dd4hep::json::DetElement json_det_t;
30 typedef dd4hep::json::Component json_comp_t;
31 typedef dd4hep::json::Dimension json_dim_t;
32 typedef dd4hep::json::ChildValue json_val_t;
36 
38 namespace dd4hep {
39 
41  namespace detail {
42 
44  static inline std::string _toString(const char* value) {
45  return json::_toString(value);
46  }
47 
49  template <typename T> inline std::string _toString(T value, const char* fmt) {
50  return json::_toString(value, fmt);
51  }
52  }
53 }
54 
55 #endif // JSON_HELPER_H
Detector.h
json_comp_t
dd4hep::json::Component json_comp_t
Definition: Helper.h:30
dd4hep::json::_toString
std::string _toString(const Attribute attr)
Convert json attribute to STL string.
Definition: Elements.cpp:80
dd4hep::json::Attribute
const JsonAttr * Attribute
Definition: Elements.h:38
json_dim_t
dd4hep::json::Dimension json_dim_t
Definition: Helper.h:31
Detector.h
dd4hep::_toString
std::string _toString(bool value)
String conversions: boolean value to string.
Definition: Handle.cpp:332
dd4hep::json::DocumentHandler
Class supporting to read and parse XML documents.
Definition: DocumentHandler.h:33
Factories.h
json_doc_t
dd4hep::json::Document json_doc_t
Definition: Helper.h:33
json_coll_t
dd4hep::json::Collection_t json_coll_t
Definition: Helper.h:25
json_h
dd4hep::json::Handle_t json_h
Definition: Helper.h:26
json_doc_holder_t
dd4hep::json::DocumentHolder json_doc_holder_t
Definition: Helper.h:34
json_elt_t
dd4hep::json::Element json_elt_t
Definition: Helper.h:27
dd4hep::json::Document
Class supporting the basic functionality of an JSON document.
Definition: Elements.h:296
json_handler_t
dd4hep::json::DocumentHandler json_handler_t
Definition: Helper.h:35
json_val_t
dd4hep::json::ChildValue json_val_t
Definition: Helper.h:32
dd4hep::json::DocumentHolder
Class supporting the basic functionality of an JSON document including ownership.
Definition: Elements.h:332
json_ref_t
dd4hep::json::Element json_ref_t
Definition: Helper.h:28
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::json::Handle_t
Class to easily access the properties of single JsonElements.
Definition: Elements.h:135
dd4hep::json::Collection_t
Class to support the access to collections of JsonNodes (or JsonElements)
Definition: Elements.h:239
json_attr_t
dd4hep::json::Attribute json_attr_t
Definition: Helper.h:24
ChildValue.h
DD4hepUnits.h
dd4hep::json::Element
User abstraction class to manipulate JSON elements within a document.
Definition: Elements.h:358
json_det_t
dd4hep::json::DetElement json_det_t
Definition: Helper.h:29