X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawReaderMemory.h;h=e0905c698bc830a21ab6daf9a1a6621cd4ee1386;hb=6c68754e09fedc597a1fa9e2b99cc27162fd9f8a;hp=fb1373d1b08dbeb4e9ec7f5b105646f70ec47104;hpb=7ab595b233cc58a3e047f03faec04b77ff93ec74;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawReaderMemory.h b/RAW/AliRawReaderMemory.h index fb1373d1b08..e0905c698bc 100644 --- a/RAW/AliRawReaderMemory.h +++ b/RAW/AliRawReaderMemory.h @@ -17,17 +17,17 @@ class fstream; #else #include #endif -#include +#include class AliRawReaderMemory: public AliRawReader { public : AliRawReaderMemory(); AliRawReaderMemory(UChar_t* memory, UInt_t size); -/* AliRawReaderMemory(const AliRawReaderMemory& rawReader); */ -/* AliRawReaderMemory& operator = (const AliRawReaderMemory& rawReader); */ virtual ~AliRawReaderMemory(); + virtual void RequireHeader(Bool_t required); + virtual UInt_t GetType() const {return 0;}; virtual UInt_t GetRunNumber() const {return 0;}; virtual const UInt_t* GetEventId() const {return 0;}; @@ -37,37 +37,63 @@ class AliRawReaderMemory: public AliRawReader { virtual const UInt_t* GetSubEventAttributes() const {return 0;}; virtual UInt_t GetLDCId() const {return 0;}; virtual UInt_t GetGDCId() const {return 0;}; + virtual UInt_t GetTimestamp() const {return 0;}; - virtual Int_t GetEquipmentSize() const {return 0;}; + virtual Int_t GetEquipmentSize() const; virtual Int_t GetEquipmentType() const {return 0;}; - virtual Int_t GetEquipmentId() const {return 0;}; + virtual Int_t GetEquipmentId() const; virtual const UInt_t* GetEquipmentAttributes() const {return NULL;}; virtual Int_t GetEquipmentElementSize() const {return 0;}; + virtual Int_t GetEquipmentHeaderSize() const {return 0;}; virtual Bool_t ReadHeader(); virtual Bool_t ReadNextData(UChar_t*& data); + virtual Bool_t ReadNext(UChar_t* data, Int_t size); virtual Bool_t Reset(); virtual Bool_t NextEvent(); virtual Bool_t RewindEvents(); - virtual Bool_t SetMemory( UChar_t* memory, ULong_t size ); - - protected : + virtual Bool_t SetMemory( UChar_t* memory, ULong_t size ); - UChar_t* fBuffer; // buffer for payload - UInt_t fBufferSize; // size of fBuffer in bytes - UInt_t fPosition; // Current position in memory + void SetEquipmentID(Int_t id); - virtual Bool_t ReadNext(UChar_t* data, Int_t size); + Bool_t AddBuffer(UChar_t* memory, ULong_t size, Int_t equipmentId ); + void ClearBuffers(); - ClassDef(AliRawReaderMemory, 0) // class for reading raw digits from a memory block + protected : private: + class AliRRMBuffer { + public: + AliRRMBuffer(); + AliRRMBuffer(UChar_t* pBuffer, UInt_t bufferSize, Int_t equipmentId); + ~AliRRMBuffer(); + AliRRMBuffer(const AliRRMBuffer& src); + AliRRMBuffer& operator=(const AliRRMBuffer& src); + + UChar_t* GetBuffer() const {return fBuffer;} + UInt_t GetBufferSize() const {return fBufferSize;} + Int_t GetEquipmentId() const {return fEquipmentId;} + void SetEquipmentId(Int_t equipmentId) {fEquipmentId=equipmentId;} + private: + UChar_t* fBuffer; //! buffer for payload + UInt_t fBufferSize; //! size of fBuffer in bytes + Int_t fEquipmentId; //! Equipment id + }; AliRawReaderMemory(const AliRawReaderMemory& rawReader); AliRawReaderMemory& operator = (const AliRawReaderMemory& rawReader); + + Bool_t OpenNextBuffer(); + + UInt_t fPosition; //! Current position in current buffer + vector fBuffers; //! Current buffer descriptor + UInt_t fCurrent; //! Current buffer index + + ClassDef(AliRawReaderMemory, 0) // class for reading raw digits from a memory block }; #endif +