CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLMap.h
Go to the documentation of this file.
1 #ifndef DDL_Map_H
2 #define DDL_Map_H
3 
6 
7 #include <vector>
8 #include <map>
9 #include <string>
10 
11 // Boost parser, spirit, for parsing the std::vector elements.
12 #include "boost/spirit/include/classic.hpp"
13 
14 namespace boost { namespace spirit { namespace classic { } } }
15 
16 class Mapper : public boost::spirit::classic::grammar<Mapper> {
17 public:
18  Mapper() { };
19  ~Mapper() { };
20  template <typename ScannerT> struct definition;
21 };
22 
23 class MapPair {
24 public:
25  MapPair() { };
26  ~MapPair() { };
27  void operator()(char const* str, char const* end) const;
28 };
29 
30 class MapMakeName {
31 public:
32  MapMakeName() { };
33  ~MapMakeName() { };
34  void operator()(char const* str, char const* end) const;
35 };
36 
38 public:
41  void operator()(char const* str, char const* end) const;
42 };
43 
45 
58 class DDLMap : public DDXMLElement
59 {
60  friend class MapPair;
61  friend class MapMakeName;
62  friend class MapMakeDouble;
63 
64 public:
65 
66  DDLMap( DDLElementRegistry* myreg );
67 
68  virtual ~DDLMap( void );
69 
70  void preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv );
71 
72  void processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv );
73 
75 
76 private:
79  double pDouble;
82 
83  void errorOut( const char* str );
84 
85  void do_pair( char const* str, char const* end );
86 
87  void do_makeName( char const* str, char const* end );
88 
89  void do_makeDouble( char const* str, char const* end );
90 };
91 
92 #endif
Definition: DDLMap.h:23
~MapPair()
Definition: DDLMap.h:26
ReadMapType< std::map< std::string, double > > pMapMap
Definition: DDLMap.h:78
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Called by loadAttributes AFTER attributes are loaded.
Definition: DDLMap.cc:76
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Processing the element.
Definition: DDLMap.cc:86
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:62
MapPair()
Definition: DDLMap.h:25
MapMakeDouble()
Definition: DDLMap.h:39
DDLMap(DDLElementRegistry *myreg)
Definition: DDLMap.cc:18
std::string pNameSpace
Definition: DDLMap.h:81
std::string pName
Definition: DDLMap.h:80
ReadMapType< std::map< std::string, double > > & getMapOfMaps(void)
Definition: DDLMap.cc:171
Mapper()
Definition: DDLMap.h:18
type of data representation of DDCompactView
Definition: DDCompactView.h:77
virtual std::vector< DDXMLAttribute >::const_iterator end(void)
a std::map&lt;std::string,YourType&gt; that offers a const operator[key]; if key is not stored in the std::...
Definition: DDReadMapType.h:13
~MapMakeName()
Definition: DDLMap.h:33
void do_makeName(char const *str, char const *end)
Definition: DDLMap.cc:149
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:69
~MapMakeDouble()
Definition: DDLMap.h:40
#define end
Definition: vmac.h:37
Definition: DDLMap.h:16
void do_pair(char const *str, char const *end)
Definition: DDLMap.cc:143
DDLMap handles Map container.
Definition: DDLMap.h:58
virtual ~DDLMap(void)
Definition: DDLMap.cc:22
~Mapper()
Definition: DDLMap.h:19
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:58
double pDouble
Definition: DDLMap.h:79
void errorOut(const char *str)
Definition: DDLMap.cc:162
MapMakeName()
Definition: DDLMap.h:32
The main class for processing parsed elements.
void do_makeDouble(char const *str, char const *end)
Definition: DDLMap.cc:155
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:55
dd_map_type pMap
Definition: DDLMap.h:77