Adding base classes for zmq networking and modificiations to event server
[u/mrichter/AliRoot.git] / MONITOR / AliNetMessage.h
CommitLineData
db352b46 1#ifndef AliNetMessage_H
2#define AliNetMessage_H
3
4// adapted from AliHLTMessage
5
6#include <TBufferFile.h>
7
8#ifndef ROOT_MessageTypes
9#include <MessageTypes.h>
10#endif
11#ifndef ROOT_TBits
12#include <TBits.h>
13#endif
14
15class AliNetMessage : public TBufferFile
16{
17public:
18 AliNetMessage(UInt_t what = kMESS_ANY);
19 AliNetMessage(void *buf, Int_t bufsize);
20 virtual ~AliNetMessage();
21
22 void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force);
23 void Forward();
24 void TagStreamerInfo(TVirtualStreamerInfo *info);
25 TClass *GetClass() const { return fClass;}
26 void IncrementLevel(TVirtualStreamerInfo* info);
27 void Reset();
28 void Reset(UInt_t what) { SetWhat(what); Reset(); }
29 UInt_t What() const { return fWhat; }
30 void SetLength() const;
31 void SetWhat(UInt_t what);
32
33 void EnableSchemaEvolution(Bool_t enable = kTRUE) { fEvolution = enable; }
34 Bool_t UsesSchemaEvolution() const { return fEvolution; }
35
36 void WriteObject(const TObject *obj);
37
38 static void EnableSchemaEvolutionForAll(Bool_t enable = kTRUE);
39 static Bool_t UsesSchemaEvolutionForAll();
40
41 const TList* GetStreamerInfos() const {return fInfos;}
42
43private:
44 AliNetMessage(const AliNetMessage &);
45 void operator=(const AliNetMessage &);
46
47 UInt_t fWhat; //!Message type
48 TClass *fClass; //!If message is kMESS_OBJECT pointer to object's class
49 char *fBufUncompressed; //!Uncompressed buffer
50 TList *fInfos; //Array of TStreamerInfo used in WriteObject
51 Bool_t fEvolution; //True if support for schema evolution required
52
53 static Bool_t fgEvolution; //True if global support for schema evolution required
54
55 ClassDef(AliNetMessage, 1);
56};
57#endif