DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Conversions.h
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 #ifndef DD4hep_COMPACT_CONVERSION_H
15 #define DD4hep_COMPACT_CONVERSION_H
16 
17 // C/C++ include files
18 #include <map>
19 #include <iostream>
20 
21 // Framework include files
22 #include "DD4hep/LCDD.h"
23 
25 namespace DD4hep {
26 
28  namespace XML {
29  class Handle_t;
30  }
31 
33 
38  template <typename T, typename ARG=XML::Handle_t> struct Converter {
39  typedef T to_type;
40  typedef void* user_param;
53  void operator()(ARG handle) const;
55  template <typename TYPE> TYPE* _param() const { return (TYPE*) param; }
57  template <typename TYPE> TYPE& _object() const { return *(TYPE*) param; }
59  template <typename TYPE> TYPE* _option() const { return (TYPE*) optional; }
60  };
61 } /* End namespace DD4hep */
62 #endif /* DD4hep_COMPACT_CONVERSION_H */
Converter(Geometry::LCDD &l, user_param p, user_param o)
Initializing constructor of the functor with initialization of the user parameter.
Definition: Conversions.h:51
Converter(Geometry::LCDD &l, user_param p)
Initializing constructor of the functor with initialization of the user parameter.
Definition: Conversions.h:49
Converter(Geometry::LCDD &l)
Initializing constructor of the functor.
Definition: Conversions.h:47
TYPE * _option() const
Typed access to the 2nd. user parameter (unchecked)
Definition: Conversions.h:59
void operator()(ARG handle) const
Callback operator to be specialized depending on the element type.
Basic conversion objects for handling DD4hep XML files.
Definition: Conversions.h:38
user_param param
Reference to optional user defined parameter.
Definition: Conversions.h:44
TYPE * _param() const
Typed access to the 1rst. user parameter (unchecked)
Definition: Conversions.h:55
user_param optional
Definition: Conversions.h:45
The main interface to the DD4hep detector description package.
Definition: LCDD.h:82
Geometry::LCDD & lcdd
Reference to the detector description object.
Definition: Conversions.h:42
void handle(const O *o, const C &c, F pmf)
TYPE & _object() const
Typed object access to the 1rst. user parameter (unchecked)
Definition: Conversions.h:57