File indexing completed on 2023-10-25 10:05:51
0001 #ifndef DCACHE_ADAPTOR_DCACHE_FILE_H
0002 #define DCACHE_ADAPTOR_DCACHE_FILE_H
0003
0004 #include "Utilities/StorageFactory/interface/Storage.h"
0005 #include "Utilities/StorageFactory/interface/IOFlags.h"
0006 #include <string>
0007
0008 namespace edm::storage {
0009 class DCacheFile : public Storage {
0010 public:
0011 DCacheFile(void);
0012 DCacheFile(IOFD fd);
0013 DCacheFile(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
0014 DCacheFile(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
0015 ~DCacheFile(void) override;
0016
0017 virtual void create(const char *name, bool exclusive = false, int perms = 0666);
0018 virtual void create(const std::string &name, bool exclusive = false, int perms = 0666);
0019 virtual void open(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
0020 virtual void open(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
0021
0022 using Storage::position;
0023 using Storage::read;
0024 using Storage::write;
0025
0026 IOSize read(void *into, IOSize n) override;
0027 IOSize readv(IOBuffer *into, IOSize buffers) override;
0028 IOSize readv(IOPosBuffer *into, IOSize buffers) override;
0029 IOSize write(const void *from, IOSize n) override;
0030
0031 IOOffset position(IOOffset offset, Relative whence = SET) override;
0032 void resize(IOOffset size) override;
0033
0034 void close(void) override;
0035 virtual void abort(void);
0036
0037 private:
0038 IOFD m_fd;
0039 bool m_close;
0040 std::string m_name;
0041 };
0042 }
0043 #endif