Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:32

0001 #ifndef DDL_Map_H
0002 #define DDL_Map_H
0003 
0004 #include <map>
0005 #include <string>
0006 #include <vector>
0007 
0008 #include "DetectorDescription/Core/interface/DDReadMapType.h"
0009 #include "DetectorDescription/Core/interface/DDMap.h"
0010 #include "DetectorDescription/Parser/src/DDXMLElement.h"
0011 
0012 class DDCompactView;
0013 class DDLElementRegistry;
0014 
0015 class MapPair;
0016 class MapMakeName;
0017 class MapMakeDouble;
0018 
0019 ///  DDLMap handles Map container.
0020 /** @class DDLMap
0021  * @author Michael Case
0022  *
0023  *  DDLMap.h  -  description
0024  *  -------------------
0025  *  begin: Fri Nov 28, 2003
0026  *  email: case@ucdhep.ucdavis.edu
0027  *
0028  *
0029  *  This is the Map container.  It is a c++ stye std::map <std::string, double> and
0030  *  has a name associated with the Map for the DDD name-reference system.
0031  *
0032  */
0033 class DDLMap final : public DDXMLElement {
0034   friend class MapPair;
0035   friend class MapMakeName;
0036   friend class MapMakeDouble;
0037 
0038 public:
0039   DDLMap(DDLElementRegistry* myreg);
0040 
0041   void preProcessElement(const std::string& name, const std::string& nmspace, DDCompactView& cpv) override;
0042   void processElement(const std::string& name, const std::string& nmspace, DDCompactView& cpv) override;
0043 
0044   ReadMapType<std::map<std::string, double> >& getMapOfMaps(void);
0045 
0046 private:
0047   dd_map_type pMap;
0048   ReadMapType<std::map<std::string, double> > pMapMap;
0049   double pDouble;
0050   std::string pName;
0051   std::string pNameSpace;
0052 
0053   void errorOut(const char* str);
0054 
0055   void do_pair(char const* str, char const* end);
0056 
0057   void do_makeName(char const* str, char const* end);
0058 
0059   void do_makeDouble(char const* str, char const* end);
0060 };
0061 
0062 #endif