CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/IOPool/TFileAdaptor/interface/TStorageFactoryFile.h

Go to the documentation of this file.
00001 #ifndef TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
00002 # define TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
00003 
00004 # include <vector>
00005 
00006 # include "TFile.h"
00007 
00008 # include "Utilities/StorageFactory/interface/IOPosBuffer.h"
00009 
00010 
00011 class Storage;
00012 
00014 class TStorageFactoryFile : public TFile
00015 {
00016 public:
00017   ClassDef(TStorageFactoryFile, 0); // ROOT File operating on CMS Storage.
00018 
00019   // Due to limitations in the ROOT plugin manager, TStorageFactoryFile must
00020   // provide a constructor matching all the different variants that other
00021   // ROOT plugins might use
00022 
00023   // This one is to match TXNetFile
00024   TStorageFactoryFile(const char *name, Option_t *option,
00025                       const char *ftitle, Int_t compress, Int_t netopt,
00026                       Bool_t parallelopen = kFALSE);
00027 
00028   // This matches everything else.
00029   TStorageFactoryFile(const char *name, Option_t *option = "",
00030                       const char *ftitle = "", Int_t compress = 1);
00031 
00032   ~TStorageFactoryFile(void);
00033 
00034   virtual Bool_t        ReadBuffer(char *buf, Int_t len);
00035   virtual Bool_t        ReadBuffer(char *buf, Long64_t pos, Int_t len);
00036   virtual Bool_t        ReadBufferAsync(Long64_t off, Int_t len);
00037   virtual Bool_t        ReadBuffers(char *buf,  Long64_t *pos, Int_t *len, Int_t nbuf);
00038   virtual Bool_t        WriteBuffer(const char *buf, Int_t len);
00039 
00040   void                  ResetErrno(void) const;
00041 
00042 protected:
00043   virtual Int_t         SysOpen(const char *pathname, Int_t flags, UInt_t mode);
00044   virtual Int_t         SysClose(Int_t fd);
00045   virtual Long64_t      SysSeek(Int_t fd, Long64_t offset, Int_t whence);
00046   virtual Int_t         SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
00047   virtual Int_t         SysSync(Int_t fd);
00048 
00049 private:
00050   void                  Initialize(const char *name, Option_t *option = "");
00051 
00052   Bool_t                ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
00053 
00054   TStorageFactoryFile(void);
00055 
00056   Storage               *storage_;              //< Real underlying storage
00057 };
00058 
00059 #endif // TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H