CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/IOPool/Streamer/interface/MsgHeader.h

Go to the documentation of this file.
00001 #ifndef IOPool_Streamer_MsgHeader_h
00002 #define IOPool_Streamer_MsgHeader_h
00003 
00004 #include "IOPool/Streamer/interface/MsgTools.h"
00005 // as it is in memory of file
00006 struct Header
00007 {
00008   Header(uint32 code,uint32 size):code_(code)
00009   { convert(size,size_); }
00010 
00011   uint8 code_; // type of the message
00012   char_uint32 size_; // of entire message including all headers
00013 
00014   // 20-Jul-2006, KAB: added enumeration for message types
00015   enum Codes { INVALID = 0, INIT = 1, EVENT = 2, DONE = 3, EOFRECORD = 4,
00016                HEADER_REQUEST = 5, EVENT_REQUEST = 6,
00017                CONS_REG_REQUEST = 7, CONS_REG_RESPONSE = 8,
00018                DQM_INIT = 9, DQM_EVENT = 10, DQMEVENT_REQUEST = 11,
00019                INIT_SET = 12, NEW_INIT_AVAILABLE = 13, ERROR_EVENT = 14,
00020                FILE_CLOSE_REQUEST = 15, SPARE1 = 16, SPARE2 = 17 };
00021 };
00022 
00023 // as we need to see it
00024 class HeaderView
00025 {
00026 public:
00027   HeaderView(void* buf)
00028   {
00029     Header* h = (Header*)buf;
00030     code_ = h->code_;
00031     size_ = convert32(h->size_);
00032   }
00033 
00034   uint32 code() const { return code_; }
00035   uint32 size() const { return size_; }
00036 private:
00037   uint32 code_;
00038   uint32 size_;
00039 };
00040 
00041 #endif