CMS 3D CMS Logo

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 #include <memory>
6 
7 #include "TFile.h"
8 
11 
12 class Storage;
13 
15 class TStorageFactoryFile : public TFile {
16 public:
17  ClassDefOverride(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,
25  Option_t *option,
26  const char *ftitle,
27  Int_t compress,
28  Int_t netopt,
29  Bool_t parallelopen = kFALSE);
30 
31  // This matches everything else.
32  TStorageFactoryFile(const char *name, Option_t *option = "", const char *ftitle = "", Int_t compress = 1);
33 
34  ~TStorageFactoryFile(void) override;
35 
36  Bool_t ReadBuffer(char *buf, Int_t len) override;
37  Bool_t ReadBuffer(char *buf, Long64_t pos, Int_t len) override;
38  Bool_t ReadBufferAsync(Long64_t off, Int_t len) override;
39  Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) override;
40  Bool_t WriteBuffer(const char *buf, Int_t len) override;
41 
42  void ResetErrno(void) const override;
43 
44 protected:
45  Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override;
46  Int_t SysClose(Int_t fd) override;
47  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override;
48  Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override;
49  Int_t SysSync(Int_t fd) override;
50 
51 private:
52  void Initialize(const char *name, Option_t *option = "");
53 
54  Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
55 
57 
58  TStorageFactoryFile(void);
59 
61 };
62 
63 #endif // TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
size
Write out results.
void ResetErrno(void) const override
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override
Int_t SysClose(Int_t fd) override
Bool_t ReadBufferAsync(Long64_t off, Int_t len) override
Bool_t ReadBuffer(char *buf, Int_t len) override
edm::propagate_const< std::unique_ptr< Storage > > storage_
ClassDefOverride(TStorageFactoryFile, 0)
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override
~TStorageFactoryFile(void) override
Int_t SysSync(Int_t fd) override
Bool_t WriteBuffer(const char *buf, Int_t len) override
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) override
Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
fd
Definition: ztee.py:136
void Initialize(const char *name, Option_t *option="")
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override