DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
OpaqueDataBinder.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 DD4HEP_OPAQUEDATABINDER_H
14 #define DD4HEP_OPAQUEDATABINDER_H
15 
16 // Framework include files
17 #include "DD4hep/Printout.h"
18 
19 // C/C++ include files
20 #include <string>
21 
23 namespace dd4hep {
24 
26  namespace detail {
27 
29 
34  struct ValueBinder { };
35 
37 
42  struct VectorBinder { };
43 
45 
50  struct ListBinder { };
51 
53 
58  struct SetBinder { };
59 
61 
66  struct MapBinder { };
67 
69 
76  public:
78  OpaqueDataBinder() = default;
80  ~OpaqueDataBinder() = default;
81 
83  template <typename BINDER, typename OBJECT> static
84  bool bind(const BINDER& b, OBJECT& object, const std::string& typ, const std::string& val);
85 
87  template <typename OBJECT> static
88  bool bind_sequence(OBJECT& object, const std::string& typ, const std::string& val);
89 
91  template <typename BINDER, typename OBJECT> static
92  bool bind_map(const BINDER& b, OBJECT& o, const std::string& key_type, const std::string& val_type);
93 
95  template <typename BINDER, typename OBJECT> static
96  bool insert_map(const BINDER& b, OBJECT& o,
97  const std::string& key_type, const std::string& key,
98  const std::string& val_type, const std::string& val);
100  template <typename BINDER, typename OBJECT> static
101  bool insert_map(const BINDER& b, OBJECT& o,
102  const std::string& key_type, const std::string& val_type,
103  const std::string& pair_data);
104  };
105  }
106 } /* End namespace dd4hep */
107 #endif /* DD4HEP_OPAQUEDATABINDER_H */
dd4hep::detail::ValueBinder
Helper class to bind string values to C++ data objects (primitive or complex)
Definition: OpaqueDataBinder.h:34
dd4hep::detail::OpaqueDataBinder::bind_sequence
static bool bind_sequence(OBJECT &object, const std::string &typ, const std::string &val)
Binding function for sequences (unmapped STL containers)
dd4hep::detail::OpaqueDataBinder::OpaqueDataBinder
OpaqueDataBinder()=default
Default constructor.
dd4hep::detail::VectorBinder
Helper class to bind string values to a STL vector of data objects (primitive or complex)
Definition: OpaqueDataBinder.h:42
dd4hep::detail::OpaqueDataBinder::~OpaqueDataBinder
~OpaqueDataBinder()=default
Default destructor.
dd4hep::detail::ListBinder
Helper class to bind string values to a STL list of data objects (primitive or complex)
Definition: OpaqueDataBinder.h:50
dd4hep::detail::OpaqueDataBinder::bind
static bool bind(const BINDER &b, OBJECT &object, const std::string &typ, const std::string &val)
Binding function for scalar items. See the implementation function for the concrete instantiations.
dd4hep::detail::OpaqueDataBinder::insert_map
static bool insert_map(const BINDER &b, OBJECT &o, const std::string &key_type, const std::string &key, const std::string &val_type, const std::string &val)
Filling function for STL maps.
Definition: OpaqueDataBinder.cpp:302
key
unsigned char key
Definition: AlignmentsCalculator.cpp:69
dd4hep::detail::OpaqueDataBinder
Helper class to bind string values to C++ data items.
Definition: OpaqueDataBinder.h:75
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::detail::OpaqueDataBinder::bind_map
static bool bind_map(const BINDER &b, OBJECT &o, const std::string &key_type, const std::string &val_type)
Binding function for STL maps. Does not fill data!
Definition: OpaqueDataBinder.cpp:272
dd4hep::detail::MapBinder
Helper class to bind STL map objects.
Definition: OpaqueDataBinder.h:66
Printout.h
dd4hep::detail::SetBinder
Helper class to bind string values to a STL set of data objects (primitive or complex)
Definition: OpaqueDataBinder.h:58