BmnRoot
Loading...
Searching...
No Matches
EventCatalogue.h
Go to the documentation of this file.
1
8#ifndef EVENTCATALOGUE_H
9#define EVENTCATALOGUE_H
10
11// #include "TObject.h"
12
13#include <curl/curl.h>
14#include <memory>
15#include <string>
16#include <vector>
17using namespace std;
18
21{
22 public:
23 static const int Version = 1;
24
25 string StorageName = "";
26 string FilePath = "";
27 int EventNumber = -1;
28
29 string SoftwareVersion = "";
30 int PeriodNumber = -1;
31 int RunNumber = -1;
32
33 int TrackNumber = -1;
34};
35
38{
39 public:
65
72 EventCondition(searchAttributes attribute, matchCriteria condition);
73 EventCondition(searchAttributes attribute, matchCriteria condition, int value);
74 EventCondition(searchAttributes attribute, matchCriteria condition, unsigned int value);
75 EventCondition(searchAttributes attribute, matchCriteria condition, double value);
76 EventCondition(searchAttributes attribute, matchCriteria condition, string value);
77 virtual ~EventCondition() {}
78
79 private:
81
82 searchAttributes EventAttribute;
83 matchCriteria EventMatchCriteria;
84
85 // 1 - int, 2 - unsigned int, 3 - double, 4 - TString, 5 - TDatime
86 int iValueType;
87 int iValue;
88 unsigned int uiValue;
89 double dValue;
90 string strValue;
91};
92
99{
100 public:
102 virtual ~EventCatalogue();
103
110 vector<unique_ptr<EventInfo>> GetEventList(vector<unique_ptr<EventCondition>> event_conditions);
111
119 unique_ptr<EventInfo> GetEventInfo(string storage_name, string file_path, int event_number);
120
129 int AddEventInfo(string storage_name, string file_path, int event_number, EventInfo event_metadata);
130
136 int AddEventInfo(string json_file_path);
137
146 int UpdateEventInfo(string storage_name, string file_path, int event_number, EventInfo event_metadata);
147
155 int DeleteEventInfo(string storage_name, string file_path, int event_number);
156
164 int CheckEventInfo(string storage_name, string file_path, int event_number);
165
173 int PrintEventInfo(string storage_name, string file_path, int event_number);
174
180 int AddStorageInfo(string storage_name);
181
187 int AddSoftwareInfo(string software_version);
188
195 vector<unique_ptr<EventInfo>> EventCatalogueRequest(string rest_api_request);
196
203 int EventCatalogueChecks(int& file_not_found, vector<unique_ptr<EventInfo>>& event_list);
204
210 int EventCatalogueStats(int& record_count);
211
216 void SetVerbose(int verbose_level = 2) { VerboseLevel = verbose_level; }
217
218 private:
219 CURL* curlInstance; // CURL instance created while the constructor
220 string ServiceUrl; // common part of the url for REST API request
221 string ServiceAccount; // user account
222
223 int VerboseLevel = 2; // VerboseLevel: 0 - without messages except errors, 1 - normal output, 2 - detailed output,
224 // 3 - debug output
225
226 int PostRequest(string RequestUrl, string json_string, string success_message);
227
228 // ClassDef(EventCatalogue, 1)
229};
230
231#endif /* !EVENTCATALOGUE_H */
virtual ~EventCatalogue()
int DeleteEventInfo(string storage_name, string file_path, int event_number)
int AddSoftwareInfo(string software_version)
int UpdateEventInfo(string storage_name, string file_path, int event_number, EventInfo event_metadata)
void SetVerbose(int verbose_level=2)
vector< unique_ptr< EventInfo > > EventCatalogueRequest(string rest_api_request)
int AddEventInfo(string storage_name, string file_path, int event_number, EventInfo event_metadata)
int CheckEventInfo(string storage_name, string file_path, int event_number)
int AddStorageInfo(string storage_name)
int EventCatalogueStats(int &record_count)
int EventCatalogueChecks(int &file_not_found, vector< unique_ptr< EventInfo > > &event_list)
vector< unique_ptr< EventInfo > > GetEventList(vector< unique_ptr< EventCondition > > event_conditions)
int PrintEventInfo(string storage_name, string file_path, int event_number)
unique_ptr< EventInfo > GetEventInfo(string storage_name, string file_path, int event_number)
Class for describing a condition to search for necessary event metadata.
searchAttributes
enumeration for attributes, which can be used in searching event metadata
matchCriteria
enumeration for conditions, which can be used for matching with a specified value
virtual ~EventCondition()
Class presenting Event Info (Metadata) Structure.
int PeriodNumber
number of experiment session, when the event was collected
string SoftwareVersion
version of the software used for processing the event
string FilePath
path of the file containing the event
static const int Version
structure (API) version
int TrackNumber
number of tracks in the event
int RunNumber
number of experiment run, when the event was collected
int EventNumber
event number in the file
string StorageName
storage name, where the file with the event is located
STL namespace.