Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:19

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   };
0032 };
0033 
0034 // as we need to see it
0035 class HeaderView {
0036 public:
0037   HeaderView(void* buf) {
0038     Header* h = (Header*)buf;
0039     code_ = h->code_;
0040     size_ = convert32(h->size_);
0041   }
0042 
0043   uint32 code() const { return code_; }
0044   uint32 size() const { return size_; }
0045 
0046 private:
0047   uint32 code_;
0048   uint32 size_;
0049 };
0050 
0051 #endif