CMS 3D CMS Logo

MsgHeader.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_MsgHeader_h
2 #define IOPool_Streamer_MsgHeader_h
3 
5 // as it is in memory of file
6 namespace edm::streamer {
7  struct Header {
8  Header(uint32 code, uint32 size) : code_(code) { convert(size, size_); }
9 
10  uint8 code_; // type of the message
11  char_uint32 size_; // of entire message including all headers
12 
13  // 20-Jul-2006, KAB: added enumeration for message types
14  enum Codes {
15  INVALID = 0,
16  INIT = 1,
17  EVENT = 2,
18  DONE = 3, // EOFRECORD = 4 is no longer used
23  DQM_INIT = 9,
24  DQM_EVENT = 10,
26  INIT_SET = 12,
30  SPARE1 = 16,
31  SPARE2 = 17,
32  PADDING = 255 //reserved for padding
33  };
34  };
35 
36  // as we need to see it
37  class HeaderView {
38  public:
39  HeaderView(void* buf) {
40  Header* h = (Header*)buf;
41  code_ = h->code_;
42  size_ = convert32(h->size_);
43  }
44 
45  uint32 code() const { return code_; }
46  uint32 size() const { return size_; }
47 
48  private:
51  };
52 } // namespace edm::streamer
53 #endif
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:43
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:29
unsigned char uint8
Definition: MsgTools.h:12
uint32 size() const
Definition: MsgHeader.h:46
uint32 code() const
Definition: MsgHeader.h:45
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
Header(uint32 code, uint32 size)
Definition: MsgHeader.h:8
unsigned int uint32
Definition: MsgTools.h:14
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
char_uint32 size_
Definition: MsgHeader.h:11