]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/RAWDatarec/AliRawReaderMemory.h
Adding Domenico Colella as responsible for SPD part in TRI pp
[u/mrichter/AliRoot.git] / RAW / RAWDatarec / AliRawReaderMemory.h
CommitLineData
7ab595b2 1#ifndef ALIRAWREADERMEMORY_H
2#define ALIRAWREADERMEMORY_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////////////////
9///
10/// This is a class for reading raw data memory.
11///
12///////////////////////////////////////////////////////////////////////////////
13
14#include "AliRawReader.h"
15#ifdef __CINT__
16class fstream;
17#else
18#include <Riostream.h>
19#endif
e8692df9 20#include <vector>
7ab595b2 21
714281ef 22using std::vector;
7ab595b2 23
24class AliRawReaderMemory: public AliRawReader {
25 public :
26 AliRawReaderMemory();
27 AliRawReaderMemory(UChar_t* memory, UInt_t size);
7ab595b2 28 virtual ~AliRawReaderMemory();
29
299738b9 30 virtual void RequireHeader(Bool_t required);
31
7ab595b2 32 virtual UInt_t GetType() const {return 0;};
33 virtual UInt_t GetRunNumber() const {return 0;};
34 virtual const UInt_t* GetEventId() const {return 0;};
35 virtual const UInt_t* GetTriggerPattern() const {return 0;};
36 virtual const UInt_t* GetDetectorPattern() const {return 0;};
37 virtual const UInt_t* GetAttributes() const {return 0;};
38 virtual const UInt_t* GetSubEventAttributes() const {return 0;};
39 virtual UInt_t GetLDCId() const {return 0;};
40 virtual UInt_t GetGDCId() const {return 0;};
741c154c 41 virtual UInt_t GetTimestamp() const {return 0;};
7ab595b2 42
e8692df9 43 virtual Int_t GetEquipmentSize() const;
7ab595b2 44 virtual Int_t GetEquipmentType() const {return 0;};
e8692df9 45 virtual Int_t GetEquipmentId() const;
7ab595b2 46 virtual const UInt_t* GetEquipmentAttributes() const {return NULL;};
47 virtual Int_t GetEquipmentElementSize() const {return 0;};
299738b9 48 virtual Int_t GetEquipmentHeaderSize() const {return 0;};
7ab595b2 49
50 virtual Bool_t ReadHeader();
51 virtual Bool_t ReadNextData(UChar_t*& data);
bf22797a 52 virtual Bool_t ReadNext(UChar_t* data, Int_t size);
7ab595b2 53
54 virtual Bool_t Reset();
55
56 virtual Bool_t NextEvent();
57 virtual Bool_t RewindEvents();
58
012425c9 59 virtual Bool_t SetMemory( UChar_t* memory, ULong_t size );
60
e8692df9 61 void SetEquipmentID(Int_t id);
7ab595b2 62
e8692df9 63 Bool_t AddBuffer(UChar_t* memory, ULong_t size, Int_t equipmentId );
64 void ClearBuffers();
7ab595b2 65
e8692df9 66 protected :
7ab595b2 67
68 private:
e8692df9 69 class AliRRMBuffer {
70 public:
71 AliRRMBuffer();
72 AliRRMBuffer(UChar_t* pBuffer, UInt_t bufferSize, Int_t equipmentId);
73 ~AliRRMBuffer();
74 AliRRMBuffer(const AliRRMBuffer& src);
75 AliRRMBuffer& operator=(const AliRRMBuffer& src);
76
77 UChar_t* GetBuffer() const {return fBuffer;}
78 UInt_t GetBufferSize() const {return fBufferSize;}
79 Int_t GetEquipmentId() const {return fEquipmentId;}
80 void SetEquipmentId(Int_t equipmentId) {fEquipmentId=equipmentId;}
81 private:
82 UChar_t* fBuffer; //! buffer for payload
83 UInt_t fBufferSize; //! size of fBuffer in bytes
84 Int_t fEquipmentId; //! Equipment id
85 };
7ab595b2 86
87 AliRawReaderMemory(const AliRawReaderMemory& rawReader);
88 AliRawReaderMemory& operator = (const AliRawReaderMemory& rawReader);
e8692df9 89
90 Bool_t OpenNextBuffer();
91
92 UInt_t fPosition; //! Current position in current buffer
93 vector<AliRRMBuffer> fBuffers; //! Current buffer descriptor
94 UInt_t fCurrent; //! Current buffer index
95
96 ClassDef(AliRawReaderMemory, 0) // class for reading raw digits from a memory block
7ab595b2 97};
98
99#endif
76a7ad7a 100