test
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 
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 
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
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:54
MapPair()
Definition: DDLMap.h:30
MapMakeDouble()
Definition: DDLMap.h:44
DDLMap(DDLElementRegistry *myreg)
Definition: DDLMap.cc:13
std::string pNameSpace
Definition: DDLMap.h:83
std::string pName
Definition: DDLMap.h:82
ReadMapType< std::map< std::string, double > > & getMapOfMaps(void)
Definition: DDLMap.cc:159
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
Definition: DDLMap.cc:78
Mapper()
Definition: DDLMap.h:23
type of data representation of DDCompactView
Definition: DDCompactView.h:90
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:38
void do_makeName(char const *str, char const *end)
Definition: DDLMap.cc:137
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:61
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
Definition: DDLMap.cc:68
~MapMakeDouble()
Definition: DDLMap.h:45
#define end
Definition: vmac.h:37
Definition: DDLMap.h:21
void do_pair(char const *str, char const *end)
Definition: DDLMap.cc:131
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
void errorOut(const char *str)
Definition: DDLMap.cc:150
MapMakeName()
Definition: DDLMap.h:37
The main class for processing parsed elements.
void do_makeDouble(char const *str, char const *end)
Definition: DDLMap.cc:143
void operator()(char const *str, char const *end) const
Definition: DDLMap.cc:47
dd_map_type pMap
Definition: DDLMap.h:79