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 class DavixFile : public Storage {
9 public:
10  DavixFile(void);
11  DavixFile(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
12  DavixFile(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
13  ~DavixFile(void) override;
14  static void configureDavixLogLevel();
15 
16  virtual void create(const char *name, bool exclusive = false, int perms = 0666);
17  virtual void create(const std::string &name, bool exclusive = false, int perms = 0666);
18  virtual void open(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
19  virtual void open(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
20 
21  using Storage::position;
22  using Storage::read;
23  using Storage::write;
24 
25  IOSize read(void *into, IOSize n) override;
26  IOSize readv(IOBuffer *into, IOSize buffers) override;
27  IOSize readv(IOPosBuffer *into, IOSize buffers) override;
28  IOSize write(const void *from, IOSize n) override;
29  IOOffset position(IOOffset offset, Relative whence = SET) override;
30  void resize(IOOffset size) override;
31 
32  void close(void) override;
33  virtual void abort(void);
34 
35 private:
36  // Cannot use as C++ smart pointer for Davix_fd
37  // Because Davix_fd is not available in C++ header files and
38  // sizeof cannot with incomplete types
39  Davix_fd *m_fd;
40  std::unique_ptr<Davix::DavPosix> m_davixPosix;
42 };
43 
44 #endif // DAVIX_ADAPTOR_DAVIX_FILE_H
Storage::size
virtual IOOffset size(void) const
Definition: Storage.cc:77
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DavixFile::close
void close(void) override
Definition: DavixFile.cc:33
Storage::SET
Definition: Storage.h:22
Storage::Relative
Relative
Definition: Storage.h:22
DavixFile::resize
void resize(IOOffset size) override
Definition: DavixFile.cc:371
DavixFile::m_name
std::string m_name
Definition: DavixFile.h:41
Storage.h
DavixFile::configureDavixLogLevel
static void configureDavixLogLevel()
Definition: DavixFile.cc:67
DavixFile::m_davixPosix
std::unique_ptr< Davix::DavPosix > m_davixPosix
Definition: DavixFile.h:40
DavixFile::~DavixFile
~DavixFile(void) override
Definition: DavixFile.cc:28
IOFlags.h
IOFlags::OpenRead
Definition: IOFlags.h:7
DavixFile::readv
IOSize readv(IOBuffer *into, IOSize buffers) override
Definition: DavixFile.cc:220
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DavixFile::create
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: DavixFile.cc:144
DavixFile::write
IOSize write(const void *from, IOSize n) override
Definition: DavixFile.cc:341
IOBuffer
Definition: IOBuffer.h:7
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
DavixFile::open
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: DavixFile.cc:160
DavixFile::m_fd
Davix_fd * m_fd
Definition: DavixFile.h:39
DavixFile
Definition: DavixFile.h:8
generator_cfi.exclusive
exclusive
Definition: generator_cfi.py:24
Storage::position
virtual IOOffset position(void) const
Definition: Storage.cc:72
IOInput::read
int read(void)
Definition: IOInput.cc:52
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
IOPosBuffer
Definition: IOPosBuffer.h:7
DavixFile::abort
virtual void abort(void)
Definition: DavixFile.cc:51
DavixFile::DavixFile
DavixFile(void)
Definition: DavixFile.cc:18
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
IOSize
size_t IOSize
Definition: IOTypes.h:14
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13216
Storage
Definition: Storage.h:20
Storage::write
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:44