Logo ROOT   6.08/07
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__CONVERSION_RULE_PARSER_H
5 #define R__CONVERSION_RULE_PARSER_H
6 
7 #include <list>
8 #include <map>
9 #include <string>
10 #include <ostream>
11 #include <utility>
12 
13 #ifndef ROOT_RConfigure
14 #include "RConfigure.h"
15 #endif
16 
17 #ifndef R__TSCHEMATYPE_H
18 #include "TSchemaType.h"
19 #endif
20 
21 //namespace clang {
22 // class CXXRecordDecl;
23 //}
24 
25 namespace ROOT
26 {
27  //---------------------------------------------------------------------------
28  // Global variables
29  //---------------------------------------------------------------------------
30  typedef std::map<std::string, std::string> SchemaRuleMap_t;
31  typedef std::map<std::string, std::list<SchemaRuleMap_t> > SchemaRuleClassMap_t;
32  extern SchemaRuleClassMap_t gReadRules;
33  extern SchemaRuleClassMap_t gReadRawRules;
34 
35  typedef std::map<std::string, ROOT::Internal::TSchemaType> MembersTypeMap_t;
36  typedef std::map<std::string, std::string> MembersMap_t;
37 
38  //---------------------------------------------------------------------------
39  // Create the data member name-type map
40  //---------------------------------------------------------------------------
41  // void CreateNameTypeMap( const clang::CXXRecordDecl &cl, MembersTypeMap_t& members );
42 
43  //---------------------------------------------------------------------------
44  // Check if given rule contains references to valid data members
45  //---------------------------------------------------------------------------
46  bool HasValidDataMembers( SchemaRuleMap_t& rule, MembersTypeMap_t& members );
47 
48  //---------------------------------------------------------------------------
49  // Write the conversion function for Read rule
50  //---------------------------------------------------------------------------
51  void WriteReadRuleFunc( SchemaRuleMap_t& rule, int index,
52  std::string& mappedName,
53  MembersTypeMap_t& members, std::ostream& output );
54 
55 
56  //---------------------------------------------------------------------------
57  // Write the conversion function for ReadRaw rule
58  //---------------------------------------------------------------------------
59  void WriteReadRawRuleFunc( SchemaRuleMap_t& rule, int index,
60  std::string& mappedName,
61  MembersTypeMap_t& members, std::ostream& output );
62 
63  //---------------------------------------------------------------------------
64  // Write schema rules
65  //---------------------------------------------------------------------------
66  void WriteSchemaList( std::list<SchemaRuleMap_t>& rules,
67  const std::string& listName, std::ostream& output );
68 
69  //---------------------------------------------------------------------------
70  // Get the list of includes defined in schema rules
71  //---------------------------------------------------------------------------
72  void GetRuleIncludes( std::list<std::string> &result );
73 
74  //---------------------------------------------------------------------------
75  // Parse read pragma
76  //---------------------------------------------------------------------------
77  bool ParseRule( std::string rule, MembersMap_t &result, std::string &error_string );
78 
79  //---------------------------------------------------------------------------
80  // Parse read pragma
81  //---------------------------------------------------------------------------
82  void ProcessReadPragma( const char* args );
83 
84  //---------------------------------------------------------------------------
85  // Parse readraw pragma
86  //---------------------------------------------------------------------------
87  void ProcessReadRawPragma( const char* args );
88 }
89 
90 #endif // R__CONVERSION_RULE_PARSER_H
91 
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"...
std::map< std::string, ROOT::Internal::TSchemaType > MembersTypeMap_t
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
void WriteSchemaList(std::list< SchemaRuleMap_t > &rules, const std::string &listName, std::ostream &output)
Write schema rules.
bool HasValidDataMembers(SchemaRuleMap_t &rule, MembersTypeMap_t &members)
Check if given rule contains references to valid data members.
bool ParseRule(std::string rule, MembersMap_t &result, std::string &error_string)
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::list< SchemaRuleMap_t > > SchemaRuleClassMap_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.
std::map< std::string, std::string > MembersMap_t
double result[121]
std::map< std::string, std::string > SchemaRuleMap_t