BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
UniRunPeriod.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// UniRunPeriod header file
3// Generated 05-11-2015
4// ----------------------------------------------------------------------
5
6/** UniRunPeriod.h
7 ** Class for the table: run_period
8 **/
9
10#ifndef UniRunPERIOD_H
11#define UniRunPERIOD_H 1
12
13#include "TDatime.h"
14#include "TString.h"
15#include "UniConnection.h"
16#include "uni_db_structures.h"
17
19{
20 private:
21 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
22 /// connection to the database
24
25 /// period number
27 /// start datetime
29 /// end datetime
31
32 // Constructor
33 UniRunPeriod(UniConnection* db_connect, int period_number, TDatime start_datetime, TDatime* end_datetime);
34 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
35
36 public:
37 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
38 virtual ~UniRunPeriod(); // Destructor
39
40 // static class functions
41 /// add new run period to the database
42 static UniRunPeriod* CreateRunPeriod(int period_number, TDatime start_datetime, TDatime* end_datetime);
43 /// get run period from the database
44 static UniRunPeriod* GetRunPeriod(int period_number);
45 /// check run period exists in the database: 1- true, 0 - false, <0 - database operation error
46 static int CheckRunPeriodExists(int period_number);
47 /// delete run period from the database
48 static int DeleteRunPeriod(int period_number);
49 /// print all run periods
50 static int PrintAll();
51
52 // Getters
53 /// get period number of the current run period
55 /// get start datetime of the current run period
57 /// get end datetime of the current run period
59 {
60 if (ts_end_datetime == nullptr)
61 return nullptr;
62 else
63 return new TDatime(*ts_end_datetime);
64 }
65
66 // Setters
67 /// set period number of the current run period
68 int SetPeriodNumber(int period_number);
69 /// set start datetime of the current run period
70 int SetStartDatetime(TDatime start_datetime);
71 /// set end datetime of the current run period
72 int SetEndDatetime(TDatime* end_datetime);
73
74 /// print information about current run period
75 void Print();
76 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
77
78 /// get numbers of runs existing in the Database for a selected period
79 /// \param[in] period_number period number for selected run numbers' range
80 /// \param[out] run_numbers pairs (period number+run numbers) of the really existing runs for a selected range (from
81 /// start to end)
82 /// \return size of 'run_numbers' array. if size < 0, return value corresponds to error number
83 static int GetRunNumbers(UniqueRunNumber*& run_numbers, int period_number);
84 /// get first run number for a selected period
85 /// \param[in] period_number a selected period number to find the minimal run number
86 /// \return minimal run number for a selected period. if number < 0, the return value corresponds to the error
87 /// number
88 static int GetFirstRunNumber(int period_number);
89 /// get last run number for a selected period
90 /// \param[in] period_number a selected period number to find the maximal run number
91 /// \return maximal run number for a selected period. if number < 0, the return value corresponds to the error
92 /// number
93 static int GetLastRunNumber(int period_number);
94 /// get period number for specified datetime
95 /// \param[in] datetime date with time to search for period number
96 /// \return period number for specified date with time. if not found, returns 0, in case of errors error code < 0
97 static int GetPeriodNumber(TDatime datetime);
98 /// get period number for specified string containing datetime in SQL format ("DD-MM-YYYY hh:mm:ss")
99 /// \param[in] pcdatetime string in the SQL format containing date with time to search for period number
100 /// \return period number for specified date with time. if not found, returns 0, in case of errors error code < 0
101 static int GetPeriodNumber(const char* pcdatetime);
102
104};
105
106#endif
#define ClassDef(name, id)
UniRunPeriod.h Class for the table: run_period.
int GetPeriodNumber()
get period number of the current run period
TDatime * GetEndDatetime()
get end datetime of the current run period
void Print()
print information about current run period
static UniRunPeriod * GetRunPeriod(int period_number)
get run period from the database
int SetEndDatetime(TDatime *end_datetime)
set end datetime of the current run period
int SetPeriodNumber(int period_number)
set period number of the current run period
TDatime ts_start_datetime
start datetime
static int GetFirstRunNumber(int period_number)
get first run number for a selected period
int i_period_number
period number
static int CheckRunPeriodExists(int period_number)
check run period exists in the database: 1- true, 0 - false, <0 - database operation error
int SetStartDatetime(TDatime start_datetime)
set start datetime of the current run period
static int DeleteRunPeriod(int period_number)
delete run period from the database
static int GetLastRunNumber(int period_number)
get last run number for a selected period
static UniRunPeriod * CreateRunPeriod(int period_number, TDatime start_datetime, TDatime *end_datetime)
add new run period to the database
UniConnection * connectionDB
connection to the database
virtual ~UniRunPeriod()
TDatime * ts_end_datetime
end datetime
static int GetRunNumbers(UniqueRunNumber *&run_numbers, int period_number)
get numbers of runs existing in the Database for a selected period
static int PrintAll()
print all run periods
TDatime GetStartDatetime()
get start datetime of the current run period
UniRunPeriod(UniConnection *db_connect, int period_number, TDatime start_datetime, TDatime *end_datetime)