Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-06 08:34:23

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 #ifndef DD4HEP_DETECTORLOAD_H
0014 #define DD4HEP_DETECTORLOAD_H
0015 
0016 // Framework includes
0017 #include <DD4hep/Detector.h>
0018 
0019 // C/C++ include files
0020 
0021 /// Namespace for the AIDA detector description toolkit
0022 namespace dd4hep {
0023 
0024   /// Namespace for the AIDA detector description toolkit supporting XML utilities
0025   namespace xml  { 
0026     class Handle_t;
0027     class UriReader;
0028   }
0029 
0030   class Detector;
0031 
0032   /// Data implementation class of the Detector interface
0033   /** 
0034    *  This class is a view on the generic Detector implementation and deals with
0035    *  all issues parsing XML files.
0036    *
0037    *  The calls "fromXML" and "fromCompact" in the Detector implementation
0038    *  call this subclass.
0039    *
0040    *  \author  M.Frank
0041    *  \version 1.0
0042    */
0043   class DetectorLoad  {
0044   public:
0045     friend class Detector;
0046 
0047   protected:
0048     /// Reference to the Detector instance
0049     Detector* m_detDesc = 0;
0050 
0051   protected:
0052     /// Default constructor (protected, for sub-classes)
0053     DetectorLoad(Detector* description);
0054 
0055   public:
0056 #ifdef G__ROOT
0057     /// No defautl constructor
0058     DetectorLoad() = default;
0059 #else
0060     /// No defautl constructor
0061     DetectorLoad() = delete;
0062 #endif
0063     /// No move constructor
0064     DetectorLoad(DetectorLoad&& copy) = delete;
0065     /// Default copy constructor
0066     DetectorLoad(const DetectorLoad& copy) = default;
0067 
0068     /// Default constructor (public, if used as a handle)
0069     DetectorLoad(Detector& description);
0070     /// Default destructor
0071     virtual ~DetectorLoad();
0072     /// Copy assignment constructor
0073     DetectorLoad& operator=(const DetectorLoad& copy) = default;
0074     /// No move assignment
0075     DetectorLoad& operator=(DetectorLoad&& copy) = delete;
0076 
0077     /// Process XML unit and adopt all data from source structure.
0078     virtual void processXML(const std::string& fname, xml::UriReader* entity_resolver=0);
0079     /// Process XML unit and adopt all data from source structure.
0080     virtual void processXML(const xml::Handle_t& base, const std::string& fname, xml::UriReader* entity_resolver=0);
0081     /// Process XML unit and adopt all data from source string in momory.
0082     virtual void processXMLString(const char* xmldata);
0083     /// Process XML unit and adopt all data from source string in momory.
0084     /** Subsequent parsers may use the entity resolver.
0085      */
0086     virtual void processXMLString(const char* xmldata, xml::UriReader* entity_resolver);
0087     /// Process a given DOM (sub-) tree
0088     virtual void processXMLElement(const std::string& msg_source, const xml::Handle_t& root);
0089     /// Process a given DOM (sub-) tree
0090     virtual void processXMLElement(const xml::Handle_t& root, DetectorBuildType type);
0091   };
0092 
0093 }         /* End namespace dd4hep         */
0094 #endif // DD4HEP_DETECTORLOAD_H