Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/io:$Id$
2// Author: Rene Brun 19/05/2006
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TFileCacheWrite
13#define ROOT_TFileCacheWrite
15#include "TObject.h"
17class TFile;
19class TFileCacheWrite : public TObject {
22 Long64_t fSeekStart; ///< Seek value of first block in cache
23 Int_t fBufferSize; ///< Allocated size of fBuffer
24 Int_t fNtot; ///< Total size of cached blocks
25 TFile *fFile; ///< Pointer to file
26 char *fBuffer; ///< [fBufferSize] buffer of contiguous prefetched blocks
27 Bool_t fRecursive; ///< flag to avoid recursive calls
30 TFileCacheWrite(const TFileCacheWrite &) = delete; //cannot be copied
35 TFileCacheWrite(TFile *file, Int_t buffersize);
36 virtual ~TFileCacheWrite();
37 virtual Bool_t Flush();
38 virtual Int_t GetBytesInCache() const { return fNtot; }
39 void Print(Option_t *option="") const override;
40 virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len);
41 virtual Int_t WriteBuffer(const char *buf, Long64_t pos, Int_t len);
42 virtual void SetFile(TFile *file);
44 ClassDefOverride(TFileCacheWrite,1) //TFile cache when writing
int Int_t
Definition: RtypesCore.h:45
long long Long64_t
Definition: RtypesCore.h:80
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
A cache when writing files over the network.
Int_t fBufferSize
Allocated size of fBuffer.
Int_t fNtot
Total size of cached blocks.
char * fBuffer
[fBufferSize] buffer of contiguous prefetched blocks
virtual Bool_t Flush()
Flush the current write buffer to the file.
TFile * fFile
Pointer to file.
Default Constructor.
TFileCacheWrite & operator=(const TFileCacheWrite &)=delete
Bool_t fRecursive
flag to avoid recursive calls
void Print(Option_t *option="") const override
Print class internal structure.
virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
Called by the read cache to check if the requested data is not in the write cache buffer.
TFileCacheWrite(const TFileCacheWrite &)=delete
virtual void SetFile(TFile *file)
Set the file using this cache.
Long64_t fSeekStart
Seek value of first block in cache.
virtual Int_t GetBytesInCache() const
virtual Int_t WriteBuffer(const char *buf, Long64_t pos, Int_t len)
Write buffer at position pos in the write buffer.
virtual ~TFileCacheWrite()
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
Mother of all ROOT objects.
Definition: TObject.h:37
Definition: file.py:1