ROOT logo
// @(#)root/io:$Id: TFileCacheWrite.h 23122 2008-04-10 14:56:30Z rdm $
// Author: Rene Brun   19/05/2006

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TFileCacheWrite
#define ROOT_TFileCacheWrite


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TFileCacheWrite                                                      //
//                                                                      //
// TFile cache when writing                                             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TFile;

class TFileCacheWrite : public TObject {

protected:
   Long64_t      fSeekStart;      //Seek value of first block in cache
   Int_t         fBufferSize;     //Allocated size of fBuffer
   Int_t         fNtot;           //Total size of cached blocks
   TFile        *fFile;           //Pointer to file
   char         *fBuffer;         //[fBufferSize] buffer of contiguous prefetched blocks
   Bool_t        fRecursive;      //flag to avoid recursive calls

private:
   TFileCacheWrite(const TFileCacheWrite &);            //cannot be copied
   TFileCacheWrite& operator=(const TFileCacheWrite &);

public:
   TFileCacheWrite();
   TFileCacheWrite(TFile *file, Int_t buffersize);
   virtual ~TFileCacheWrite();
   virtual Bool_t      Flush();
   virtual Int_t       GetBytesInCache() const { return fNtot; }
   virtual void        Print(Option_t *option="") const;
   virtual Int_t       ReadBuffer(char *buf, Long64_t pos, Int_t len);
   virtual Int_t       WriteBuffer(const char *buf, Long64_t pos, Int_t len);
   virtual void        SetFile(TFile *file);

   ClassDef(TFileCacheWrite,1)  //TFile cache when writing
};

#endif
 TFileCacheWrite.h:1
 TFileCacheWrite.h:2
 TFileCacheWrite.h:3
 TFileCacheWrite.h:4
 TFileCacheWrite.h:5
 TFileCacheWrite.h:6
 TFileCacheWrite.h:7
 TFileCacheWrite.h:8
 TFileCacheWrite.h:9
 TFileCacheWrite.h:10
 TFileCacheWrite.h:11
 TFileCacheWrite.h:12
 TFileCacheWrite.h:13
 TFileCacheWrite.h:14
 TFileCacheWrite.h:15
 TFileCacheWrite.h:16
 TFileCacheWrite.h:17
 TFileCacheWrite.h:18
 TFileCacheWrite.h:19
 TFileCacheWrite.h:20
 TFileCacheWrite.h:21
 TFileCacheWrite.h:22
 TFileCacheWrite.h:23
 TFileCacheWrite.h:24
 TFileCacheWrite.h:25
 TFileCacheWrite.h:26
 TFileCacheWrite.h:27
 TFileCacheWrite.h:28
 TFileCacheWrite.h:29
 TFileCacheWrite.h:30
 TFileCacheWrite.h:31
 TFileCacheWrite.h:32
 TFileCacheWrite.h:33
 TFileCacheWrite.h:34
 TFileCacheWrite.h:35
 TFileCacheWrite.h:36
 TFileCacheWrite.h:37
 TFileCacheWrite.h:38
 TFileCacheWrite.h:39
 TFileCacheWrite.h:40
 TFileCacheWrite.h:41
 TFileCacheWrite.h:42
 TFileCacheWrite.h:43
 TFileCacheWrite.h:44
 TFileCacheWrite.h:45
 TFileCacheWrite.h:46
 TFileCacheWrite.h:47
 TFileCacheWrite.h:48
 TFileCacheWrite.h:49
 TFileCacheWrite.h:50
 TFileCacheWrite.h:51
 TFileCacheWrite.h:52
 TFileCacheWrite.h:53
 TFileCacheWrite.h:54
 TFileCacheWrite.h:55
 TFileCacheWrite.h:56
 TFileCacheWrite.h:57
 TFileCacheWrite.h:58