CMS 3D CMS Logo

DDLMap.h
Go to the documentation of this file.
1 #ifndef DDL_Map_H
2 #define DDL_Map_H
3 
4 #include <map>
5 #include <string>
6 #include <vector>
7 
11 #include "boost/spirit/home/classic/core/non_terminal/grammar.hpp"
12 // Boost parser, spirit, for parsing the std::vector elements.
13 #include "boost/spirit/include/classic.hpp"
14 #include "boost/thread/pthread/once_atomic.hpp"
15 
16 class DDCompactView;
17 class DDLElementRegistry;
18 
19 namespace boost { namespace spirit { namespace classic { } } }
20 
21 class Mapper : public boost::spirit::classic::grammar<Mapper> {
22 public:
23  Mapper() { };
24  ~Mapper() { };
25  template <typename ScannerT> struct definition;
26 };
27 
28 class MapPair {
29 public:
30  MapPair() { };
31  ~MapPair() { };
32  void operator()(char const* str, char const* end) const;
33 };
34 
35 class MapMakeName {
36 public:
37  MapMakeName() { };
38  ~MapMakeName() { };
39  void operator()(char const* str, char const* end) const;
40 };
41 
43 public:
46  void operator()(char const* str, char const* end) const;
47 };
48 
50 
63 class DDLMap final : public DDXMLElement
64 {
65  friend class MapPair;
66  friend class MapMakeName;
67  friend class MapMakeDouble;
68 
69 public:
70 
71  DDLMap( DDLElementRegistry* myreg );
72 
73  void preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv ) override;
74  void processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv ) override;
75 
76  ReadMapType<std::map<std::string,double> > & getMapOfMaps( void );
77 
78 private:
81  double pDouble;
84 
85  void errorOut( const char* str );
86 
87  void do_pair( char const* str, char const* end );
88 
89  void do_makeName( char const* str, char const* end );
90 
91  void do_makeDouble( char const* str, char const* end );
92 };
93 
94 #endif
Definition: DDLMap.h:28
~MapPair()
Definition: DDLMap.h:31
ReadMapType< std::map< std::string, double > > pMapMap
Definition: DDLMap.h:80
MapPair()
Definition: DDLMap.h:30
MapMakeDouble()
Definition: DDLMap.h:44
Definition: CLHEP.h:16
std::string pNameSpace
Definition: DDLMap.h:83
std::string pName
Definition: DDLMap.h:82
Mapper()
Definition: DDLMap.h:23
type of data representation of DDCompactView
Definition: DDCompactView.h:90
a std::map<std::string,YourType> that offers a const operator[key]; if key is not stored in the std::...
Definition: DDReadMapType.h:13
~MapMakeName()
Definition: DDLMap.h:38
~MapMakeDouble()
Definition: DDLMap.h:45
#define end
Definition: vmac.h:37
Definition: DDLMap.h:21
DDLMap handles Map container.
Definition: DDLMap.h:63
~Mapper()
Definition: DDLMap.h:24
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:48
double pDouble
Definition: DDLMap.h:81
MapMakeName()
Definition: DDLMap.h:37
The main class for processing parsed elements.
dd_map_type pMap
Definition: DDLMap.h:79