Logo ROOT   6.19/01
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 #include "RConfigure.h"
14 
15 #include "TSchemaType.h"
16 #include "DllImport.h"
17 
18 namespace ROOT
19 {
20  //---------------------------------------------------------------------------
21  // Global variables
22  //---------------------------------------------------------------------------
23  typedef std::map<std::string, std::string> SchemaRuleMap_t;
24  typedef std::map<std::string, std::list<SchemaRuleMap_t> > SchemaRuleClassMap_t;
27 
28  typedef std::map<std::string, ROOT::Internal::TSchemaType> MembersTypeMap_t;
29 
30  //---------------------------------------------------------------------------
31  // Create the data member name-type map
32  //---------------------------------------------------------------------------
33  // void CreateNameTypeMap( const clang::CXXRecordDecl &cl, MembersTypeMap_t& members );
34 
35  //---------------------------------------------------------------------------
36  // Check if given rule contains references to valid data members
37  //---------------------------------------------------------------------------
39  std::string& error_string);
40 
41  //---------------------------------------------------------------------------
42  // Write the conversion function for Read rule
43  //---------------------------------------------------------------------------
44  void WriteReadRuleFunc( SchemaRuleMap_t& rule, int index,
45  std::string& mappedName,
46  MembersTypeMap_t& members, std::ostream& output );
47 
48 
49  //---------------------------------------------------------------------------
50  // Write the conversion function for ReadRaw rule
51  //---------------------------------------------------------------------------
52  void WriteReadRawRuleFunc( SchemaRuleMap_t& rule, int index,
53  std::string& mappedName,
54  MembersTypeMap_t& members, std::ostream& output );
55 
56  //---------------------------------------------------------------------------
57  // Write schema rules
58  //---------------------------------------------------------------------------
59  void WriteSchemaList( std::list<SchemaRuleMap_t>& rules,
60  const std::string& listName, std::ostream& output );
61 
62  //---------------------------------------------------------------------------
63  // Get the list of includes defined in schema rules
64  //---------------------------------------------------------------------------
65  void GetRuleIncludes( std::list<std::string> &result );
66 
67  //---------------------------------------------------------------------------
68  // Parse read pragma
69  //---------------------------------------------------------------------------
70  bool ParseRule(std::string rule, ROOT::Internal::MembersMap_t &result, std::string &error_string );
71 
72  //---------------------------------------------------------------------------
73  // Parse read pragma
74  //---------------------------------------------------------------------------
75  void ProcessReadPragma( const char* args, std::string& error_string );
76 
77  //---------------------------------------------------------------------------
78  // Parse readraw pragma
79  //---------------------------------------------------------------------------
80  void ProcessReadRawPragma( const char* args, std::string& error_string );
81 }
82 
83 #endif // R__CONVERSION_RULE_PARSER_H
84 
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
VSD Structures.
Definition: StringConv.hxx:21
void WriteSchemaList(std::list< SchemaRuleMap_t > &rules, const std::string &listName, std::ostream &output)
Write schema rules.
void ProcessReadPragma(const char *args, std::string &error_string)
I am being called when a read pragma is encountered.
bool HasValidDataMembers(SchemaRuleMap_t &rule, MembersTypeMap_t &members, std::string &error_string)
Check if given rule contains references to valid data members.
void GetRuleIncludes(std::list< std::string > &result)
Get the list of includes specified in the shema rules.
R__EXTERN 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, std::string &error_string)
I am being called then a readraw pragma is encountered.
R__EXTERN SchemaRuleClassMap_t gReadRawRules
#define R__EXTERN
Definition: DllImport.h:27
bool ParseRule(std::string rule, ROOT::Internal::MembersMap_t &result, std::string &error_string)
Parse the schema rule as specified in the LinkDef file.
static void output(int code)
Definition: gifencode.c:226
std::map< std::string, std::string > SchemaRuleMap_t
std::map< std::string, std::string > MembersMap_t
Definition: TSchemaType.h:20