CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DDPlugins.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_DD_PLUGINS_H
2 #define DETECTOR_DESCRIPTION_DD_PLUGINS_H
3 
5 #include "DD4hep/Factories.h"
6 #include "DD4hep/Plugins.h"
7 
8 namespace dd4hep {
9 
10  template <typename T>
11  class DDCMSDetElementFactory : public dd4hep::PluginFactoryBase {
12  public:
13  static long create(dd4hep::Detector& detector, cms::DDParsingContext& context, dd4hep::xml::Handle_t element);
14  };
15 } // namespace dd4hep
16 
17 namespace {
18  template <typename P, typename S>
19  class Factory;
20  DD4HEP_PLUGIN_FACTORY_ARGS_3(long, dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*) {
22  }
23 } // namespace
24 
25 #define DECLARE_DDCMS_DETELEMENT(name, func) \
26  DD4HEP_OPEN_PLUGIN(dd4hep, ddcms_det_element_##name) { \
27  typedef DDCMSDetElementFactory<ddcms_det_element_##name> _IMP; \
28  template <> \
29  long _IMP::create(dd4hep::Detector& d, cms::DDParsingContext& c, xml::Handle_t e) { \
30  return func(d, c, e); \
31  } \
32  DD4HEP_PLUGINSVC_FACTORY( \
33  ddcms_det_element_##name, name, long(dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*), __LINE__) \
34  }
35 
36 #endif
tuple dd4hep
Definition: dd4hep_cff.py:3
static constexpr float a0
static long create(dd4hep::Detector &detector, cms::DDParsingContext &context, dd4hep::xml::Handle_t element)