9#ifndef UniDetectorPARAMETER_H
10#define UniDetectorPARAMETER_H 1
62 unsigned char* parameter_value,
63 Long_t size_parameter_value,
80 unsigned char* parameter_value,
81 Long_t size_parameter_value,
114 return tmp_parameter_value;
158 vector<UniValue*> parameter_value,
199 const char* parameter_name,
207 const char* parameter_name,
213 const char* parameter_name,
221 const char* parameter_name,
229 const char* parameter_name,
234 const char* file_path);
238 const char* parameter_name,
241 const char* file_path);
258 void GetEnd(
int& end_period,
int& end_run);
285 int SetUNC(
unsigned char* p_parameter_value,
Long_t size_parameter_value);
294 unsigned char* parameter_value,
295 Long_t size_parameter_value,
#define ClassDef(name, id)
static UniDetectorParameter * GetDetectorParameter(TString detector_name, TString parameter_name, int period_number, int run_number, TDatime *usage_time=nullptr, int value_key=0)
get detector parameter value (integer value key is optional, default, 0)
Long_t GetParameterValueSize()
get size of parameter value of the current detector parameter
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, TString parameter_name, int start_period, int start_run, int end_period, int end_run, UniValue *parameter_value, int value_key=0)
write detector parameter value presented by a single value (integer value key is optional,...
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, TString parameter_name, int start_period, int start_run, int end_period, int end_run, unsigned char *parameter_value, Long_t size_parameter_value, enumValueType enum_parameter_type, int value_key=0)
static int DeleteDetectorParameter(int value_id)
delete detector parameter from the database
int SetStart(int start_period, int start_run)
set start period and run of the current parameter value
static int ReadObjectJSON(const char *detector_name, const char *parameter_name, int period_number, int run_number, TObject *&ptr_object)
read ROOT object as a JSON parameter from from the Database for the selected run
static int ReadObjectBinary(const char *detector_name, const char *parameter_name, int period_number, int run_number, TObject *&ptr_object)
read ROOT object as a binary parameter from from the Database for the selected run
int SetValue(vector< UniValue * > parameter_value)
set value to detector parameter presented by an array
TDatime * ts_expiry_date
expiry date
int i_end_period
end period
enumValueType GetParameterType()
get parameter type of the current parameter value
int SetValueKey(int value_key)
set value key of the current detector parameter
int SetDetectorName(TString detector_name)
set detector name of the current detector parameter
void GetStart(int &start_period, int &start_run)
get start period and run of the current parameter value
int GetStartPeriod()
get start period of the current detector parameter
Long_t sz_parameter_value
size of parameter value
int SetExpiryDate(TDatime *expiry_date)
set expiry date of the current detector parameter
TString GetParameterName()
get parameter name of the current parameter value
virtual ~UniDetectorParameter()
void GetEnd(int &end_period, int &end_run)
get end period and run of the current parameter value
UniValue * GetValue()
get value of detector parameter presented by a single value
static int CheckDetectorParameterExists(int value_id)
check detector parameter exists in the database: 1- true, 0 - false, <0 - database operation error
static int WriteObjectJSON(const char *detector_name, const char *parameter_name, int start_period, int start_run, int end_period, int end_run, TObject *ptr_object)
write ROOT object as a JSON parameter to the Database from start run to end one
int SetEnd(int end_period, int end_run)
set end period and run of the current parameter value
unsigned char * GetParameterValue()
get parameter value of the current detector parameter
TDatime * GetExpiryDate()
get expiry date of the current detector parameter
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, TString parameter_name, int start_period, int start_run, int end_period, int end_run, vector< UniValue * > parameter_value, int value_key=0)
write detector parameter value presented by an array (integer value key is optional,...
UniConnection * connectionDB
connection to the database
int SetParameterId(int parameter_id)
set parameter id of the current detector parameter
static TObjArray * Search(UniSearchCondition &search_condition)
get parameters' values corresponding to the specified single condition and set owner for search_condi...
unsigned char * blob_parameter_value
parameter value
int GetValue(vector< UniValue * > ¶meter_value)
get value of detector parameter presented by an array
static TObjArray * Search(TObjArray &search_conditions)
get parameters' values corresponding to the specified (vector) conditions and set owner for search_co...
int SetEndPeriod(int end_period)
set end period of the current detector parameter
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, int parameter_id, int start_period, int start_run, int end_period, int end_run, int value_key, unsigned char *parameter_value, Long_t size_parameter_value, TDatime *expiry_date)
add new detector parameter to the database
static int PrintAll(bool isNonExpiredOnly)
print all detector parameters, except expired if the flag is true
static int ReadFile(const char *detector_name, const char *parameter_name, int period_number, int run_number, const char *file_path)
read a whole file with parameter value (with given detector and parameter names) from the Database fo...
TString GetDetectorName()
get detector name of the current detector parameter
TString str_detector_name
detector name
int SetValue(UniValue *parameter_value)
set value to detector parameter presented by a single value
int GetParameterId()
get parameter id of the current detector parameter
int SetEndRun(int end_run)
set end run of the current detector parameter
int SetStartRun(int start_run)
set start run of the current detector parameter
int GetEndPeriod()
get end period of the current detector parameter
void Print()
print information about current detector parameter
static int WriteObjectBinary(const char *detector_name, const char *parameter_name, int start_period, int start_run, int end_period, int end_run, TObject *ptr_object)
write ROOT object as a binary parameter to the Database from start run to end one
static int DeleteDetectorParameter(TString detector_name, TString parameter_name, int start_period, int start_run, int end_period, int end_run, TDatime *usage_time, int value_key=0)
delete detector parameter value (integer value key is optional, default, 0)
int SetUNC(unsigned char *p_parameter_value, Long_t size_parameter_value)
static int WriteFile(const char *detector_name, const char *parameter_name, int start_period, int start_run, int end_period, int end_run, const char *file_path)
write a whole file with parameter value (with given detector and parameter names) to the Database fro...
static int PrintAll()
print all detector parameters
int i_parameter_id
parameter id
static UniDetectorParameter * GetDetectorParameter(int value_id)
get detector parameter from the database
int GetEndRun()
get end run of the current detector parameter
int GetValueId()
get value id of the current detector parameter
UniDetectorParameter(UniConnection *db_connect, int value_id, TString detector_name, int parameter_id, int start_period, int start_run, int end_period, int end_run, int value_key, unsigned char *parameter_value, Long_t size_parameter_value, TDatime *expiry_date)
int SetStartPeriod(int start_period)
set start period of the current detector parameter
int GetValueKey()
get value key of the current detector parameter
int GetStartRun()
get start run of the current detector parameter
int SetParameterValue(unsigned char *parameter_value, Long_t size_parameter_value)
set parameter value of the current detector parameter
unsigned char * GetUNC(enumValueType enum_parameter_type=UndefinedType)
Parse detector parameter's values and write them to the database: txtFile - path to the text file wit...
int i_start_period
start period