Fixes in online reconstruction, Event Display and Storage Manager
[u/mrichter/AliRoot.git] / MONITOR / MONITORzmq / AliStorageEventManager.h
1 #ifndef AliStorageEventManager_H
2 #define AliStorageEventManager_H
3
4 #include "AliESDEvent.h"
5 #include "AliStorageTypes.h"
6
7 #include <vector>
8 #include <string>
9 #include <sstream>
10
11 #include <TMessage.h>
12 #include <TFile.h>
13
14 namespace zmq
15 {
16         class context_t;
17         class socket_t;
18 }
19
20 class AliStorageEventManager
21 {
22 public:
23         static AliStorageEventManager* GetEventManagerInstance();
24
25         void Send(std::vector<serverListStruct> list,storageSockets socket);
26         bool Send(struct serverRequestStruct *request,storageSockets socket,int timeout = -1);
27         bool Send(struct clientRequestStruct *request,storageSockets socket,int timeout = -1);
28         void Send(AliESDEvent *event,storageSockets socket);
29         void Send(TFile *file,storageSockets socket);
30         void Send(struct recPointsStruct *files,storageSockets socket);
31         void Send(long message,storageSockets socket);
32         void Send(bool message,storageSockets socket);
33         void SendAsXml(AliESDEvent *event,storageSockets socket);
34         
35         std::vector<serverListStruct> GetServerListVector(storageSockets socket,int timeout=-1);
36         AliESDEvent* GetEvent(storageSockets socket,int timeout=-1);
37         TFile* GetFile(storageSockets socket,int timeout=-1);
38         struct recPointsStruct* GetFiles(storageSockets socket,int timeout=-1);
39         struct serverRequestStruct* GetServerStruct(storageSockets socket);
40         struct clientRequestStruct* GetClientStruct(storageSockets socket,int timeout=-1);
41         long GetLong(storageSockets socket);
42         bool GetBool(storageSockets socket);
43
44
45         bool CreateSocket(storageSockets socket);
46 private:
47         AliStorageEventManager();
48         ~AliStorageEventManager();
49
50         static AliStorageEventManager *fManagerInstance;
51
52         std::string fStorageServer;
53         std::string fEventServer;
54         int fStorageServerPort;
55         int fStorageClientPort;
56         int fEventServerPort;
57         int fXmlServerPort;
58         int fItsPointsServerPort;
59         
60         zmq::context_t *fContexts[7];
61         zmq::socket_t *fSockets[7];
62
63         AliStorageEventManager(const AliStorageEventManager&);
64         AliStorageEventManager& operator=(const AliStorageEventManager&);
65 };
66
67 #endif