ROOT  6.06/09
Reference Guide
RConversionRuleParser.h
Go to the documentation of this file.
1 // @(#)root/core:$Id$
2 // author: Lukasz Janyst <ljanyst@cern.ch>
3 
4 #ifndef R__R_CONVERSION_RULE_PARSER_H
5 #define R__R_CONVERSION_RULE_PARSER_H
6 
7 #if !defined(__CINT__)
8 // Avoid clutering the dictionary (in particular with the STL declaration)
9 
10 #include <list>
11 #include <map>
12 #include <string>
13 #include <ostream>
14 #include <utility>
15 
16 #ifndef ROOT_RConfigure
17 #include "RConfigure.h"
18 #endif
19 
20 #ifndef R__TSCHEMATYPE_H
21 #include "TSchemaType.h"
22 #endif
23 
24 //namespace clang {
25 // class CXXRecordDecl;
26 //}
27 
28 namespace ROOT
29 {
30  //---------------------------------------------------------------------------
31  // Global variables
32  //---------------------------------------------------------------------------
33  typedef std::map<std::string, std::string> SchemaRuleMap_t;
34  typedef std::map<std::string, std::list<SchemaRuleMap_t> > SchemaRuleClassMap_t;
35  extern SchemaRuleClassMap_t gReadRules;
36  extern SchemaRuleClassMap_t gReadRawRules;
37 
38  typedef std::map<std::string, ROOT::Internal::TSchemaType> MembersTypeMap_t;
39  typedef std::map<std::string, std::string> MembersMap_t;
40 
41  //---------------------------------------------------------------------------
42  // Create the data member name-type map
43  //---------------------------------------------------------------------------
44  // void CreateNameTypeMap( const clang::CXXRecordDecl &cl, MembersTypeMap_t& members );
45 
46  //---------------------------------------------------------------------------
47  // Check if given rule contains references to valid data members
48  //---------------------------------------------------------------------------
49  bool HasValidDataMembers( SchemaRuleMap_t& rule, MembersTypeMap_t& members );
50 
51  //---------------------------------------------------------------------------
52  // Write the conversion function for Read rule
53  //---------------------------------------------------------------------------
54  void WriteReadRuleFunc( SchemaRuleMap_t& rule, int index,
55  std::string& mappedName,
56  MembersTypeMap_t& members, std::ostream& output );
57 
58 
59  //---------------------------------------------------------------------------
60  // Write the conversion function for ReadRaw rule
61  //---------------------------------------------------------------------------
62  void WriteReadRawRuleFunc( SchemaRuleMap_t& rule, int index,
63  std::string& mappedName,
64  MembersTypeMap_t& members, std::ostream& output );
65 
66  //---------------------------------------------------------------------------
67  // Write schema rules
68  //---------------------------------------------------------------------------
69  void WriteSchemaList( std::list<SchemaRuleMap_t>& rules,
70  const std::string& listName, std::ostream& output );
71 
72  //---------------------------------------------------------------------------
73  // Get the list of includes defined in schema rules
74  //---------------------------------------------------------------------------
75  void GetRuleIncludes( std::list<std::string> &result );
76 
77  //---------------------------------------------------------------------------
78  // Parse read pragma
79  //---------------------------------------------------------------------------
80  bool ParseRule( std::string rule, MembersMap_t &result, std::string &error_string );
81 
82  //---------------------------------------------------------------------------
83  // Parse read pragma
84  //---------------------------------------------------------------------------
85  void ProcessReadPragma( const char* args );
86 
87  //---------------------------------------------------------------------------
88  // Parse readraw pragma
89  //---------------------------------------------------------------------------
90  void ProcessReadRawPragma( const char* args );
91 }
92 #endif // !defined(__CINT__)
93 
94 #endif // R__R_CONVERSION_RULE_PARSER_H
95 
std::map< std::string, std::list< SchemaRuleMap_t > > SchemaRuleClassMap_t
void WriteReadRawRuleFunc(SchemaRuleMap_t &rule, int index, std::string &mappedName, MembersTypeMap_t &members, std::ostream &output)
Write the conversion function for ReadRaw rule, the function name is being written to rule["funcname"...
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
void WriteSchemaList(std::list< SchemaRuleMap_t > &rules, const std::string &listName, std::ostream &output)
Write schema rules.
std::map< std::string, ROOT::Internal::TSchemaType > MembersTypeMap_t
bool ParseRule(std::string rule, MembersMap_t &result, std::string &error_string)
Parse the schema rule as specified in the LinkDef file.
void GetRuleIncludes(std::list< std::string > &result)
Get the list of includes specified in the shema rules.
SchemaRuleClassMap_t gReadRules
std::map< std::string, std::string > MembersMap_t
void WriteReadRuleFunc(SchemaRuleMap_t &rule, int index, std::string &mappedName, MembersTypeMap_t &members, std::ostream &output)
Write the conversion function for Read rule, the function name is being written to rule["funcname"]...
void ProcessReadRawPragma(const char *args)
I am being called then a readraw pragma is encountered.
SchemaRuleClassMap_t gReadRawRules
void ProcessReadPragma(const char *args)
I am being called when a read pragma is encountered.
bool HasValidDataMembers(SchemaRuleMap_t &rule, MembersTypeMap_t &members)
Check if given rule contains references to valid data members.
double result[121]
static void output(int code)
Definition: gifencode.c:226
std::map< std::string, std::string > SchemaRuleMap_t