8e8f828c33b7ae4fc2b08fad3096a04f775b2f2f
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / AliStorageDatabase.h
1 #ifndef AliStorageDatabase_H
2 #define AliStorageDatabase_H
3
4 #include "AliStorageTypes.h"
5 #include "AliESDEvent.h"
6
7 #include <string>
8 #include <vector>
9
10 #include <TSQLServer.h>
11
12 class AliStorageDatabase
13 {
14 public:
15         AliStorageDatabase();
16         ~AliStorageDatabase();
17         
18         void InsertEvent(int runNumber,
19                          int eventNumber,
20                          char *system,
21                          int multiplicity,
22                          char *filePath); //more parameters of the event can be added to this method
23
24         bool MarkEvent(struct eventStruct event);
25         void RemoveEvent(struct eventStruct event);
26         std::string GetFilePath(struct eventStruct event);
27         struct eventStruct GetOldestEvent();
28         std::vector<serverListStruct> GetList(struct listRequestStruct listStruct);
29
30         AliESDEvent* GetEvent(struct eventStruct event);
31         AliESDEvent* GetNextEvent(struct eventStruct event);
32         AliESDEvent* GetLastEvent();
33         AliESDEvent* GetPrevEvent(struct eventStruct event);
34         AliESDEvent* GetFirstEvent();
35 private:
36         std::string fHost;
37         std::string fPort;
38         std::string fDatabase;
39         std::string fUID;
40         std::string fPassword;
41         std::string fTable;
42
43         TSQLServer *fServer;
44         std::string fStoragePath;
45
46          AliStorageDatabase(const AliStorageDatabase&);
47          AliStorageDatabase& operator=(const AliStorageDatabase&);
48 };
49
50 #endif