9#ifndef UniDetectorPARAMETER_H
10#define UniDetectorPARAMETER_H 1
32 TString str_detector_name;
46 unsigned char* blob_parameter_value;
48 Long_t sz_parameter_value;
50 TDatime* ts_expiry_date;
55 TString detector_name,
62 unsigned char* parameter_value,
63 Long_t size_parameter_value,
64 TDatime* expiry_date);
80 unsigned char* parameter_value,
81 Long_t size_parameter_value,
82 TDatime* expiry_date);
112 unsigned char* tmp_parameter_value =
new unsigned char[sz_parameter_value];
113 memcpy(tmp_parameter_value, blob_parameter_value, sz_parameter_value);
114 return tmp_parameter_value;
121 if (ts_expiry_date ==
nullptr)
124 return new TDatime(*ts_expiry_date);
153 TString parameter_name,
158 vector<UniValue*> parameter_value,
162 TString parameter_name,
172 TString parameter_name,
175 TDatime* usage_time =
nullptr,
180 TString parameter_name,
200 const char* parameter_name,
205 const char* file_path);
209 const char* parameter_name,
212 const char* file_path);
219 static TObjArray*
Search(TObjArray& search_conditions);
229 void GetEnd(
int& end_period,
int& end_run);
253 int SetUNC(
unsigned char* p_parameter_value, Long_t size_parameter_value);
257 TString parameter_name,
262 unsigned char* parameter_value,
263 Long_t size_parameter_value,
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
int SetValue(vector< UniValue * > parameter_value)
set value to detector parameter presented by an array
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
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
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,...
int SetParameterId(int parameter_id)
set parameter id of the current detector parameter
static TObjArray * Search(UniSearchCondition &search_condition)
ClassDef(UniDetectorParameter, 1)
int GetValue(vector< UniValue * > ¶meter_value)
get value of detector parameter presented by an array
static TObjArray * Search(TObjArray &search_conditions)
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 ReadFile(const char *detector_name, const char *parameter_name, int period_number, int run_number, const char *file_path)
TString GetDetectorName()
get detector name of the current detector parameter
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 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)
static int PrintAll()
print all detector parameters
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
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)