CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TStorageFactoryFile.h
Go to the documentation of this file.
1 #ifndef TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
2 # define TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
3 
4 # include <vector>
5 
6 # include "TFile.h"
7 
9 
10 
11 class Storage;
12 
14 class TStorageFactoryFile : public TFile
15 {
16 public:
17  ClassDef(TStorageFactoryFile, 0); // ROOT File operating on CMS Storage.
18 
19  // Due to limitations in the ROOT plugin manager, TStorageFactoryFile must
20  // provide a constructor matching all the different variants that other
21  // ROOT plugins might use
22 
23  // This one is to match TXNetFile
24  TStorageFactoryFile(const char *name, Option_t *option,
25  const char *ftitle, Int_t compress, Int_t netopt,
26  Bool_t parallelopen = kFALSE);
27 
28  // This matches everything else.
29  TStorageFactoryFile(const char *name, Option_t *option = "",
30  const char *ftitle = "", Int_t compress = 1);
31 
33 
34  virtual Bool_t ReadBuffer(char *buf, Int_t len);
35  virtual Bool_t ReadBuffer(char *buf, Long64_t pos, Int_t len);
36  virtual Bool_t ReadBufferAsync(Long64_t off, Int_t len);
37  virtual Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
38  virtual Bool_t WriteBuffer(const char *buf, Int_t len);
39 
40  void ResetErrno(void) const;
41 
42 protected:
43  virtual Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
44  virtual Int_t SysClose(Int_t fd);
45  virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
46  virtual Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
47  virtual Int_t SysSync(Int_t fd);
48 
49 private:
50  void Initialize(const char *name, Option_t *option = "");
51 
52  Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
53 
54  TStorageFactoryFile(void);
55 
56  Storage *storage_; //< Real underlying storage
57 };
58 
59 #endif // TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
virtual Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
Definition: Storage.h:8
virtual Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
virtual Bool_t ReadBufferAsync(Long64_t off, Int_t len)
virtual Bool_t ReadBuffer(char *buf, Int_t len)
virtual Bool_t WriteBuffer(const char *buf, Int_t len)
unsigned int offset(bool)
ClassDef(TStorageFactoryFile, 0)
unsigned int UInt_t
Definition: FUTypes.h:12
void ResetErrno(void) const
virtual Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
virtual Int_t SysClose(Int_t fd)
virtual Int_t SysSync(Int_t fd)
Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
void Initialize(const char *name, Option_t *option="")
tuple size
Write out results.