Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:53:46

0001 #ifndef IOPool_Streamer_MsgHeader_h
0002 #define IOPool_Streamer_MsgHeader_h
0003 
0004 #include "IOPool/Streamer/interface/MsgTools.h"
0005 // as it is in memory of file
0006 struct Header {
0007   Header(uint32 code, uint32 size) : code_(code) { convert(size, size_); }
0008 
0009   uint8 code_;        // type of the message
0010   char_uint32 size_;  // of entire message including all headers
0011 
0012   // 20-Jul-2006, KAB: added enumeration for message types
0013   enum Codes {
0014     INVALID = 0,
0015     INIT = 1,
0016     EVENT = 2,
0017     DONE = 3,  // EOFRECORD = 4 is no longer used
0018     HEADER_REQUEST = 5,
0019     EVENT_REQUEST = 6,
0020     CONS_REG_REQUEST = 7,
0021     CONS_REG_RESPONSE = 8,
0022     DQM_INIT = 9,
0023     DQM_EVENT = 10,
0024     DQMEVENT_REQUEST = 11,
0025     INIT_SET = 12,
0026     NEW_INIT_AVAILABLE = 13,
0027     ERROR_EVENT = 14,
0028     FILE_CLOSE_REQUEST = 15,
0029     SPARE1 = 16,
0030     SPARE2 = 17,
0031     PADDING = 255  //reserved for padding
0032   };
0033 };
0034 
0035 // as we need to see it
0036 class HeaderView {
0037 public:
0038   HeaderView(void* buf) {
0039     Header* h = (Header*)buf;
0040     code_ = h->code_;
0041     size_ = convert32(h->size_);
0042   }
0043 
0044   uint32 code() const { return code_; }
0045   uint32 size() const { return size_; }
0046 
0047 private:
0048   uint32 code_;
0049   uint32 size_;
0050 };
0051 
0052 #endif