Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
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
12#include "RConfigure.h"
13
14#include "TSchemaType.h"
15#include "DllImport.h"
16
17namespace clang {
18class CXXRecordDecl;
19}
20
21namespace ROOT
22{
23 //---------------------------------------------------------------------------
24 // Global variables
25 //---------------------------------------------------------------------------
26 typedef std::map<std::string, std::string> SchemaRuleMap_t;
27 struct RRulesList {
28 bool fGenerated = false;
29 std::list<SchemaRuleMap_t> fRules;
30 const clang::CXXRecordDecl *fTargetDecl;
31
32 size_t size() const { return fRules.size(); }
33 };
34 typedef std::map<std::string, RRulesList> SchemaRuleClassMap_t;
37
38 typedef std::map<std::string, ROOT::Internal::TSchemaType> MembersTypeMap_t;
39
40 //---------------------------------------------------------------------------
41 // Create the data member name-type map
42 //---------------------------------------------------------------------------
43 // void CreateNameTypeMap( const clang::CXXRecordDecl &cl, MembersTypeMap_t& members );
44
45 //---------------------------------------------------------------------------
46 // Check if given rule contains references to valid data members
47 //---------------------------------------------------------------------------
49 std::string& error_string);
50
51 //---------------------------------------------------------------------------
52 // Write the conversion function for Read rule
53 //---------------------------------------------------------------------------
55 std::string& mappedName,
56 MembersTypeMap_t& members, std::ostream& output );
57
58
59 //---------------------------------------------------------------------------
60 // Write the conversion function for ReadRaw rule
61 //---------------------------------------------------------------------------
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, ROOT::Internal::MembersMap_t &result, std::string &error_string );
81
82 //---------------------------------------------------------------------------
83 // Parse read pragma
84 //---------------------------------------------------------------------------
85 void ProcessReadPragma( const char* args, std::string& error_string );
86
87 //---------------------------------------------------------------------------
88 // Parse readraw pragma
89 //---------------------------------------------------------------------------
90 void ProcessReadRawPragma( const char* args, std::string& error_string );
91}
92
93#endif // R__CONVERSION_RULE_PARSER_H
94
#define R__EXTERN
Definition DllImport.h:26
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
std::map< std::string, std::string > MembersMap_t
Definition TSchemaType.h:20
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
void ProcessReadPragma(const char *args, std::string &error_string)
I am being called when a read pragma is encountered.
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
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"].
R__EXTERN SchemaRuleClassMap_t gReadRules
std::map< std::string, std::string > SchemaRuleMap_t
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.
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, RRulesList > SchemaRuleClassMap_t
void ProcessReadRawPragma(const char *args, std::string &error_string)
I am being called then a readraw pragma is encountered.
R__EXTERN SchemaRuleClassMap_t gReadRawRules
bool ParseRule(std::string rule, ROOT::Internal::MembersMap_t &result, std::string &error_string)
Parse the schema rule as specified in the LinkDef file.
const clang::CXXRecordDecl * fTargetDecl
std::list< SchemaRuleMap_t > fRules
static void output()