00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TFileCacheRead
00013 #define ROOT_TFileCacheRead
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027
00028 class TFile;
00029 class TBranch;
00030
00031 class TFileCacheRead : public TObject {
00032
00033 protected:
00034 Int_t fBufferSizeMin;
00035 Int_t fBufferSize;
00036 Int_t fBufferLen;
00037
00038 Bool_t fAsyncReading;
00039
00040 Int_t fNseek;
00041 Int_t fNtot;
00042 Int_t fNb;
00043 Int_t fSeekSize;
00044 Long64_t *fSeek;
00045 Long64_t *fSeekSort;
00046 Int_t *fSeekIndex;
00047 Long64_t *fPos;
00048 Int_t *fSeekLen;
00049 Int_t *fSeekSortLen;
00050 Int_t *fSeekPos;
00051 Int_t *fLen;
00052 TFile *fFile;
00053 char *fBuffer;
00054 Bool_t fIsSorted;
00055 Bool_t fIsTransferred;
00056
00057 private:
00058 TFileCacheRead(const TFileCacheRead &);
00059 TFileCacheRead& operator=(const TFileCacheRead &);
00060
00061 public:
00062 TFileCacheRead();
00063 TFileCacheRead(TFile *file, Int_t buffersize);
00064 virtual ~TFileCacheRead();
00065 virtual void AddBranch(TBranch * , Bool_t = kFALSE) {}
00066 virtual void AddBranch(const char * , Bool_t = kFALSE) {}
00067 virtual Int_t GetBufferSize() const { return fBufferSize; };
00068 virtual Int_t GetUnzipBuffer(char ** , Long64_t , Int_t , Bool_t * ) { return -1; }
00069 virtual Bool_t IsAsyncReading() const { return fAsyncReading; };
00070 virtual Bool_t IsLearning() const {return kFALSE;}
00071 virtual void Prefetch(Long64_t pos, Int_t len);
00072 virtual void Print(Option_t *option="") const;
00073 virtual Int_t ReadBufferExt(char *buf, Long64_t pos, Int_t len, Int_t &loc);
00074 virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len);
00075 virtual void SetFile(TFile *file);
00076 virtual void SetSkipZip(Bool_t = kTRUE) {}
00077 virtual void Sort();
00078
00079 ClassDef(TFileCacheRead,1)
00080 };
00081
00082 #endif