BmnRoot
Loading...
Searching...
No Matches
UniGenerateClasses.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- UniGenerateClasses header file -----
3// ----- Created 18/08/15 by K. Gertsenberger -----
4// -------------------------------------------------------------------------
5
12#ifndef UNIGENERATECLASSES_H
13#define UNIGENERATECLASSES_H 1
14
15#include "TObjArray.h"
16#include "TString.h"
17
23
25{
26 // column name (e.g. run_number)
27 TString strColumnName;
28 // <column name> for 'not null' (e.g. run_number), *<column_name> for null (e.g. *run_number)
29 TString strColumnPointer;
30 // column name with spaces instead of '_' (e.g. run number)
31 TString strColumnNameSpace;
32 // C++/ROOT variable type corresponding column (e.g. int and int*)
33 TString strVariableType;
34 // <variable type> for 'not null', <variable type> without '*' at the end for null (e.g. int and int)
36 TString strStatementType;
37 // symbol corresponding variable type as it presented in printf (or TString::Format)
38 TString strPrintfType;
39 // member class variable name corresponding table column
40 TString strVariableName;
41 // temp variable name for tempopary copy this variable
42 TString strTempVariableName;
43 // short variable name (e.g. ComponentName for 'component_name' column
45 bool isIdentity;
46 bool isPrimary;
47 bool isCompositeKey;
48 bool isUnique;
49 bool isNullable;
50 bool isBinary;
51 bool isDateTime;
52 bool isTimeStamp;
53};
54
55// structure to join fields of another table
56struct structTableJoin
57{
58 TString strSourceTableName;
59 TString strJoinTableName;
61 TObjArray* arrManualFieldNames;
62
69};
70
72{
73 public:
74 UniGenerateClasses(); // Constructor
75 virtual ~UniGenerateClasses(); // Destructor
76
77 // Generate C++ classes - wrappers for all tables of the given database
78 // Parameters:
79 // json_configuration_file - path to JSON file with the configuration of the class generator
80 static int GenerateClasses(TString json_configuration_file);
81
83};
84
85#endif
static int GenerateClasses(TString json_configuration_file)
ClassDef(UniGenerateClasses, 2)
virtual ~UniGenerateClasses()
ConnectionType
@ ELOG_DB
@ UNIFIED_DB
TObjArray * arrManualFieldNames
structColumnInfo strJoinField