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 namespace edm::storage {
13  class Storage;
14 }
15 
17 class TStorageFactoryFile : public TFile {
18 public:
19  ClassDefOverride(TStorageFactoryFile, 0); // ROOT File operating on CMS Storage.
20 
21  // Due to limitations in the ROOT plugin manager, TStorageFactoryFile must
22  // provide a constructor matching all the different variants that other
23  // ROOT plugins might use
24 
25  // This one is to match TXNetFile
26  TStorageFactoryFile(const char *name,
27  Option_t *option,
28  const char *ftitle,
29  Int_t compress,
30  Int_t netopt,
31  Bool_t parallelopen = kFALSE);
32 
33  // This matches everything else.
34  TStorageFactoryFile(const char *name, Option_t *option = "", const char *ftitle = "", Int_t compress = 1);
35 
36  ~TStorageFactoryFile(void) override;
37 
38  Bool_t ReadBuffer(char *buf, Int_t len) override;
39  Bool_t ReadBuffer(char *buf, Long64_t pos, Int_t len) override;
40  Bool_t ReadBufferAsync(Long64_t off, Int_t len) override;
41  Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) override;
42  Bool_t WriteBuffer(const char *buf, Int_t len) override;
43 
44  void ResetErrno(void) const override;
45 
46 protected:
47  Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override;
48  Int_t SysClose(Int_t fd) override;
49  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override;
50  Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override;
51  Int_t SysSync(Int_t fd) override;
52 
53 private:
54  void Initialize(const char *name, Option_t *option = "");
55 
56  Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
57 
59 
60  TStorageFactoryFile(void);
61 
63 };
64 
65 #endif // TFILE_ADAPTOR_TSTORAGE_FACTORY_FILE_H
size
Write out results.
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override
Int_t SysClose(Int_t fd) override
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
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< edm::storage::Storage > > storage_
ClassDefOverride(TStorageFactoryFile, 0)
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override
void ResetErrno(void) const 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