/
MsgHeader.h
52 lines (45 loc) · 1.15 KB
/
MsgHeader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef IOPool_Streamer_MsgHeader_h
#define IOPool_Streamer_MsgHeader_h
#include "IOPool/Streamer/interface/MsgTools.h"
// as it is in memory of file
struct Header {
Header(uint32 code, uint32 size) : code_(code) { convert(size, size_); }
uint8 code_; // type of the message
char_uint32 size_; // of entire message including all headers
// 20-Jul-2006, KAB: added enumeration for message types
enum Codes {
INVALID = 0,
INIT = 1,
EVENT = 2,
DONE = 3, // EOFRECORD = 4 is no longer used
HEADER_REQUEST = 5,
EVENT_REQUEST = 6,
CONS_REG_REQUEST = 7,
CONS_REG_RESPONSE = 8,
DQM_INIT = 9,
DQM_EVENT = 10,
DQMEVENT_REQUEST = 11,
INIT_SET = 12,
NEW_INIT_AVAILABLE = 13,
ERROR_EVENT = 14,
FILE_CLOSE_REQUEST = 15,
SPARE1 = 16,
SPARE2 = 17,
PADDING = 255 //reserved for padding
};
};
// as we need to see it
class HeaderView {
public:
HeaderView(void* buf) {
Header* h = (Header*)buf;
code_ = h->code_;
size_ = convert32(h->size_);
}
uint32 code() const { return code_; }
uint32 size() const { return size_; }
private:
uint32 code_;
uint32 size_;
};
#endif