BmnRoot
Loading...
Searching...
No Matches
ElogRecord.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// ElogRecord header file
3// Generated 27-11-2017
4// ----------------------------------------------------------------------
5
10#ifndef ElogRecord_H
11#define ElogRecord_H 1
12
13#include "ElogConnection.h"
14#include "ElogSearchCondition.h"
15#include "TDatime.h"
16#include "TObjArray.h"
17#include "TString.h"
18
20{
21 private:
22 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
24 ElogConnection* connectionDB;
25
27 int i_record_id;
29 TDatime dt_record_date;
31 TString* str_shift_leader_id;
33 int i_type_id;
35 int* i_period_number;
37 int* i_run_number;
39 int* i_trigger_id;
41 TString* str_daq_status;
43 int* i_sp_41;
45 int* i_sp_57;
47 int* i_vkm2;
49 TString str_beam;
51 double* d_energy;
53 TString str_target;
55 double* d_target_width;
57 TString* str_record_comment;
59 int* i_system_status_id;
60
61 // Constructor
62 ElogRecord(ElogConnection* db_connect,
63 int record_id,
64 TDatime record_date,
65 TString* shift_leader_id,
66 int type_id,
67 int* period_number,
68 int* run_number,
69 int* trigger_id,
70 TString* daq_status,
71 int* sp_41,
72 int* sp_57,
73 int* vkm2,
74 TString beam,
75 double* energy,
76 TString target,
77 double* target_width,
78 TString* record_comment,
79 int* system_status_id);
80 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
81
82 public:
83 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
84 virtual ~ElogRecord(); // Destructor
85
86 // static class functions
88 static ElogRecord* CreateRecord(TDatime record_date,
89 TString* shift_leader_id,
90 int type_id,
91 int* period_number,
92 int* run_number,
93 int* trigger_id,
94 TString* daq_status,
95 int* sp_41,
96 int* sp_57,
97 int* vkm2,
98 TString beam,
99 double* energy,
100 TString target,
101 double* target_width,
102 TString* record_comment,
103 int* system_status_id);
105 static ElogRecord* GetRecord(int record_id);
107 static int CheckRecordExists(int record_id);
109 static int DeleteRecord(int record_id);
111 static int PrintAll();
112
113 // Getters
115 int GetRecordId() { return i_record_id; }
117 TDatime GetRecordDate() { return dt_record_date; }
120 {
121 if (str_shift_leader_id == nullptr)
122 return nullptr;
123 else
124 return new TString(*str_shift_leader_id);
125 }
127 int GetTypeId() { return i_type_id; }
130 {
131 if (i_period_number == nullptr)
132 return nullptr;
133 else
134 return new int(*i_period_number);
135 }
138 {
139 if (i_run_number == nullptr)
140 return nullptr;
141 else
142 return new int(*i_run_number);
143 }
146 {
147 if (i_trigger_id == nullptr)
148 return nullptr;
149 else
150 return new int(*i_trigger_id);
151 }
153 TString* GetDaqStatus()
154 {
155 if (str_daq_status == nullptr)
156 return nullptr;
157 else
158 return new TString(*str_daq_status);
159 }
161 int* GetSp41()
162 {
163 if (i_sp_41 == nullptr)
164 return nullptr;
165 else
166 return new int(*i_sp_41);
167 }
169 int* GetSp57()
170 {
171 if (i_sp_57 == nullptr)
172 return nullptr;
173 else
174 return new int(*i_sp_57);
175 }
177 int* GetVkm2()
178 {
179 if (i_vkm2 == nullptr)
180 return nullptr;
181 else
182 return new int(*i_vkm2);
183 }
185 TString GetBeam() { return str_beam; }
187 double* GetEnergy()
188 {
189 if (d_energy == nullptr)
190 return nullptr;
191 else
192 return new double(*d_energy);
193 }
195 TString GetTarget() { return str_target; }
198 {
199 if (d_target_width == nullptr)
200 return nullptr;
201 else
202 return new double(*d_target_width);
203 }
206 {
207 if (str_record_comment == nullptr)
208 return nullptr;
209 else
210 return new TString(*str_record_comment);
211 }
214 {
215 if (i_system_status_id == nullptr)
216 return nullptr;
217 else
218 return new int(*i_system_status_id);
219 }
220
221 // Setters
223 int SetRecordDate(TDatime record_date);
225 int SetShiftLeaderId(TString* shift_leader_id);
227 int SetTypeId(int type_id);
229 int SetPeriodNumber(int* period_number);
231 int SetRunNumber(int* run_number);
233 int SetTriggerId(int* trigger_id);
235 int SetDaqStatus(TString* daq_status);
237 int SetSp41(int* sp_41);
239 int SetSp57(int* sp_57);
241 int SetVkm2(int* vkm2);
243 int SetBeam(TString beam);
245 int SetEnergy(double* energy);
247 int SetTarget(TString target);
249 int SetTargetWidth(double* target_width);
251 int SetRecordComment(TString* record_comment);
253 int SetSystemStatusId(int* system_status_id);
254
256 void Print();
257 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
258
260 static TObjArray* GetRecords(int period_number, int run_number, bool findPreviousRun = false);
261
263 static TObjArray* Search(const ElogSearchCondition& search_condition);
265 static TObjArray* Search(const TObjArray& search_conditions);
266
268};
269
270#endif
virtual ~ElogRecord()
TDatime GetRecordDate()
get record date of the current record
Definition ElogRecord.h:117
ClassDef(ElogRecord, 1)
int SetShiftLeaderId(TString *shift_leader_id)
set shift leader id of the current record
int SetSystemStatusId(int *system_status_id)
set system status id of the current record
int * GetSp41()
get sp 41 of the current record
Definition ElogRecord.h:161
int SetTypeId(int type_id)
set type id of the current record
int SetVkm2(int *vkm2)
set vkm2 of the current record
int * GetSystemStatusId()
get system status id of the current record
Definition ElogRecord.h:213
static int PrintAll()
print all records
int SetRunNumber(int *run_number)
set run number of the current record
int SetTarget(TString target)
set target of the current record
TString * GetShiftLeaderId()
get shift leader id of the current record
Definition ElogRecord.h:119
double * GetEnergy()
get energy of the current record
Definition ElogRecord.h:187
int * GetVkm2()
get vkm2 of the current record
Definition ElogRecord.h:177
int SetPeriodNumber(int *period_number)
set period number of the current record
int GetRecordId()
get record id of the current record
Definition ElogRecord.h:115
int SetDaqStatus(TString *daq_status)
set daq status of the current record
int SetTriggerId(int *trigger_id)
set trigger id of the current record
static TObjArray * GetRecords(int period_number, int run_number, bool findPreviousRun=false)
get array of ElogRecord-s for a given or a previous run from the database
int * GetRunNumber()
get run number of the current record
Definition ElogRecord.h:137
int SetTargetWidth(double *target_width)
set target width of the current record
TString * GetDaqStatus()
get daq status of the current record
Definition ElogRecord.h:153
TString GetBeam()
get beam of the current record
Definition ElogRecord.h:185
int SetSp57(int *sp_57)
set sp 57 of the current record
TString GetTarget()
get target of the current record
Definition ElogRecord.h:195
int SetRecordComment(TString *record_comment)
set record comment of the current record
static int DeleteRecord(int record_id)
delete record from the database
double * GetTargetWidth()
get target width of the current record
Definition ElogRecord.h:197
TString * GetRecordComment()
get record comment of the current record
Definition ElogRecord.h:205
int SetSp41(int *sp_41)
set sp 41 of the current record
int SetBeam(TString beam)
set beam of the current record
int GetTypeId()
get type id of the current record
Definition ElogRecord.h:127
int SetEnergy(double *energy)
set energy of the current record
static ElogRecord * GetRecord(int record_id)
get record from the database
static TObjArray * Search(const ElogSearchCondition &search_condition)
get ELOG records corresponding to the specified single condition
int * GetPeriodNumber()
get period number of the current record
Definition ElogRecord.h:129
int * GetTriggerId()
get trigger id of the current record
Definition ElogRecord.h:145
static int CheckRecordExists(int record_id)
check record exists in the database: 1- true, 0 - false, <0 - database operation error
void Print()
print information about current record
static ElogRecord * CreateRecord(TDatime record_date, TString *shift_leader_id, int type_id, int *period_number, int *run_number, int *trigger_id, TString *daq_status, int *sp_41, int *sp_57, int *vkm2, TString beam, double *energy, TString target, double *target_width, TString *record_comment, int *system_status_id)
add new record to the database
int SetRecordDate(TDatime record_date)
set record date of the current record
int * GetSp57()
get sp 57 of the current record
Definition ElogRecord.h:169