|
5 | 5 | #include "Utilities/StorageFactory/interface/Storage.h" |
6 | 6 | #include <davix.hpp> |
7 | 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; |
41 | | - std::string m_name; |
42 | | -}; |
43 | | - |
| 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; |
| 42 | + std::string m_name; |
| 43 | + }; |
| 44 | +} // namespace edm::storage |
44 | 45 | #endif // DAVIX_ADAPTOR_DAVIX_FILE_H |
0 commit comments