CMS 3D CMS Logo

DavixFile.h
Go to the documentation of this file.
1 #ifndef DAVIX_ADAPTOR_DAVIX_FILE_H
2 #define DAVIX_ADAPTOR_DAVIX_FILE_H
3 
6 #include <davix.hpp>
7 
8 namespace edm::storage {
9  class DavixFile : public Storage {
10  public:
11  DavixFile(void);
12  DavixFile(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
13  DavixFile(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
14  ~DavixFile(void) override;
15  static void configureDavixLogLevel();
16 
17  virtual void create(const char *name, bool exclusive = false, int perms = 0666);
18  virtual void create(const std::string &name, bool exclusive = false, int perms = 0666);
19  virtual void open(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
20  virtual void open(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
21 
22  using Storage::position;
23  using Storage::read;
24  using Storage::write;
25 
26  IOSize read(void *into, IOSize n) override;
27  IOSize readv(IOBuffer *into, IOSize buffers) override;
28  IOSize readv(IOPosBuffer *into, IOSize buffers) override;
29  IOSize write(const void *from, IOSize n) override;
30  IOOffset position(IOOffset offset, Relative whence = SET) override;
31  void resize(IOOffset size) override;
32 
33  void close(void) override;
34  virtual void abort(void);
35 
36  private:
37  // Cannot use as C++ smart pointer for Davix_fd
38  // Because Davix_fd is not available in C++ header files and
39  // sizeof cannot with incomplete types
40  Davix_fd *m_fd;
41  std::unique_ptr<Davix::DavPosix> m_davixPosix;
43  };
44 } // namespace edm::storage
45 #endif // DAVIX_ADAPTOR_DAVIX_FILE_H
IOSize readv(IOBuffer *into, IOSize buffers) override
Definition: DavixFile.cc:221
int64_t IOOffset
Definition: IOTypes.h:20
~DavixFile(void) override
Definition: DavixFile.cc:29
void resize(IOOffset size) override
Definition: DavixFile.cc:372
virtual void abort(void)
Definition: DavixFile.cc:52
static void configureDavixLogLevel()
Definition: DavixFile.cc:68
virtual IOOffset size() const
Definition: Storage.cc:509
std::string m_name
Definition: DavixFile.h:42
size_t IOSize
Definition: IOTypes.h:15
IOSize write(const void *from, IOSize n) override
Definition: DavixFile.cc:342
void close(void) override
Definition: DavixFile.cc:34
IOSize write(unsigned char byte)
Definition: Storage.cc:329
virtual IOOffset position() const
Definition: Storage.cc:504
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: DavixFile.cc:161
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: DavixFile.cc:145
std::unique_ptr< Davix::DavPosix > m_davixPosix
Definition: DavixFile.h:41