00001 #ifndef __PXXPayloadEnvelope__H__ 00002 #define __PXXPayloadEnvelope__H__ 00003 00021 00022 #include "payloads-unpacker/payloads/PXXVUnpackable.h" 00023 00024 class PXXPayloadEnvelope : public PXXVUnpackable 00025 { 00026 public: 00027 00028 SET_LOGGER("PXXPayloadEnvelope"); 00029 00033 PXXPayloadEnvelope(); 00034 //------------------------------------------------------------------------------ 00035 00039 virtual ~PXXPayloadEnvelope() {} 00040 //------------------------------------------------------------------------------ 00041 00046 virtual Int32b_t GetPayloadLength() const; 00047 //------------------------------------------------------------------------------ 00048 00053 virtual Int32b_t GetPayloadType() const; 00054 //------------------------------------------------------------------------------ 00055 00061 virtual Long64b_t GetUniversalTime64b() const; 00062 //------------------------------------------------------------------------------ 00063 00068 virtual Int32b_t GetUnpackedEnvelopeSize() { return fIUnpackedEnvelopeSize_; } 00069 //------------------------------------------------------------------------------ 00070 00074 virtual void WriteProperties(); 00075 //------------------------------------------------------------------------------ 00076 00080 virtual void SetPayloadLength(Int32b_t l) { fIPayloadLength_ = l; } 00081 //------------------------------------------------------------------------------ 00082 00086 virtual void SetPayloadType(Int32b_t t) { fIPayloadType_ = t; } 00087 //------------------------------------------------------------------------------ 00088 00092 virtual void SetUniversalTime64b(Long64b_t t) { fLUniversalTime_ = t; } 00093 //------------------------------------------------------------------------------ 00094 00095 private: 00096 00105 virtual Int32b_t ReadData(); 00106 //------------------------------------------------------------------------------ 00107 00108 private: 00109 00110 static const Int32b_t kIEnvelopeSize_; // Fixed 16, see class description 00111 00112 Int32b_t fIPayloadLength_ ; // length of the payload (with envelope) 00113 Int32b_t fIPayloadType_ ; // Type of the payload 00114 Long64b_t fLUniversalTime_; // 64bit universal time 00115 Int32b_t fIUnpackedEnvelopeSize_ ;// Unpacked size of the envelope 00116 00117 ClassDef(PXXPayloadEnvelope, 0) // interface of payloads 00118 00119 }; 00120 00121 #ifdef __USEROOT__ // compile with ROOT 00122 typedef PXXPayloadEnvelope* PXXPayloadEnvelopePtr; 00123 #else // compile with IceTray 00124 typedef shared_ptr<PXXPayloadEnvelope> PXXPayloadEnvelopePtr; 00125 #endif 00126 00127 #endif // PXXIPAYLOAD_H