BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
UniParameter.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// UniParameter header file
3// Generated 05-11-2015
4// ----------------------------------------------------------------------
5
6/** UniParameter.h
7 ** Class for the table: parameter_
8 **/
9
10#ifndef UniParameter_H
11#define UniParameter_H 1
12
13#include "TDatime.h"
14#include "TString.h"
15#include "UniConnection.h"
16#include "uni_db_structures.h"
17
18#include <iostream>
19using namespace std;
20
21class UniParameter
22{
23 private:
24 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
25 /// connection to the database
26 UniConnection* connectionDB;
27
28 /// parameter id
30 /// parameter name
31 TString str_parameter_name;
32 /// parameter type
34 /// is array
35 bool b_is_array;
36
37 // Constructor
39 int parameter_id,
40 TString parameter_name,
41 int parameter_type,
42 bool is_array);
43 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
44
45 public:
46 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
47 virtual ~UniParameter(); // Destructor
48
49 // static class functions
50 /// add new parameter to the database
51 static UniParameter* CreateParameter(TString parameter_name, int parameter_type, bool is_array);
52 /// get parameter from the database
53 static UniParameter* GetParameter(int parameter_id);
54 /// get parameter from the database
55 static UniParameter* GetParameter(TString parameter_name);
56 /// check parameter exists in the database: 1- true, 0 - false, <0 - database operation error
57 static int CheckParameterExists(int parameter_id);
58 /// check parameter exists in the database: 1- true, 0 - false, <0 - database operation error
59 static int CheckParameterExists(TString parameter_name);
60 /// delete parameter from the database
61 static int DeleteParameter(int parameter_id);
62 /// delete parameter from the database
63 static int DeleteParameter(TString parameter_name);
64 /// print all parameters
65 static int PrintAll();
66
67 // Getters
68 /// get parameter id of the current parameter
70 /// get parameter name of the current parameter
72 /// get parameter type of the current parameter
74 /// get is array of the current parameter
75 bool GetIsArray() { return b_is_array; }
76
77 // Setters
78 /// set parameter name of the current parameter
79 int SetParameterName(TString parameter_name);
80 /// set parameter type of the current parameter
81 int SetParameterType(int parameter_type);
82 /// set is array of the current parameter
83 int SetIsArray(bool is_array);
84
85 /// print information about current parameter
86 void Print();
87 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
88
89 // enumeration 'enumValueType' is corresponding parameter_type member UniParameter, you can see it in db_structures
90 static bool CheckAndGetParameterID(TSQLServer* db_server,
91 TString parameter_name,
92 enumValueType enum_parameter_type,
93 int& parameter_id);
94
96};
97
98#endif
#define ClassDef(name, id)
TString GetParameterName()
get parameter name of the current parameter
virtual ~UniParameter()
int SetParameterName(TString parameter_name)
set parameter name of the current parameter
void Print()
print information about current parameter
bool GetIsArray()
get is array of the current parameter
static int CheckParameterExists(TString parameter_name)
check parameter exists in the database: 1- true, 0 - false, <0 - database operation error
UniConnection * connectionDB
connection to the database
static int DeleteParameter(int parameter_id)
delete parameter from the database
int i_parameter_type
parameter type
UniParameter(UniConnection *db_connect, int parameter_id, TString parameter_name, int parameter_type, bool is_array)
static int DeleteParameter(TString parameter_name)
delete parameter from the database
static int CheckParameterExists(int parameter_id)
check parameter exists in the database: 1- true, 0 - false, <0 - database operation error
static int PrintAll()
print all parameters
static UniParameter * GetParameter(TString parameter_name)
get parameter from the database
int SetIsArray(bool is_array)
set is array of the current parameter
int GetParameterId()
get parameter id of the current parameter
int i_parameter_id
parameter id
int SetParameterType(int parameter_type)
set parameter type of the current parameter
static bool CheckAndGetParameterID(TSQLServer *db_server, TString parameter_name, enumValueType enum_parameter_type, int &parameter_id)
int GetParameterType()
get parameter type of the current parameter
bool b_is_array
is array
static UniParameter * GetParameter(int parameter_id)
get parameter from the database
TString str_parameter_name
parameter name
static UniParameter * CreateParameter(TString parameter_name, int parameter_type, bool is_array)
add new parameter to the database
enumValueType
Definition json.hpp:4446