CMS 3D CMS Logo

LocalCacheFile.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_LOCAL_CACHE_FILE_H
2 #define STORAGE_FACTORY_LOCAL_CACHE_FILE_H
3 
7 #include <vector>
8 #include <string>
9 #include <memory>
10 
12 class LocalCacheFile : public Storage {
13 public:
14  LocalCacheFile(std::unique_ptr<Storage> base, const std::string &tmpdir = "");
15  ~LocalCacheFile(void) override;
16 
17  using Storage::read;
18  using Storage::write;
19 
20  bool prefetch(const IOPosBuffer *what, IOSize n) override;
21  IOSize read(void *into, IOSize n) override;
22  IOSize read(void *into, IOSize n, IOOffset pos) override;
23  IOSize readv(IOBuffer *into, IOSize n) override;
24  IOSize readv(IOPosBuffer *into, IOSize n) override;
25  IOSize write(const void *from, IOSize n) override;
26  IOSize write(const void *from, IOSize n, IOOffset pos) override;
27  IOSize writev(const IOBuffer *from, IOSize n) override;
28  IOSize writev(const IOPosBuffer *from, IOSize n) override;
29 
30  IOOffset position(IOOffset offset, Relative whence = SET) override;
31  void resize(IOOffset size) override;
32  void flush(void) override;
33  void close(void) override;
34 
35 private:
37 
39  std::vector<char> present_;
43  unsigned int cacheCount_;
44  unsigned int cacheTotal_;
45 };
46 
47 #endif // STORAGE_FACTORY_LOCAL_CACHE_FILE_H
Storage::size
virtual IOOffset size(void) const
Definition: Storage.cc:77
start
Definition: start.py:1
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
propagate_const.h
LocalCacheFile::~LocalCacheFile
~LocalCacheFile(void) override
Definition: LocalCacheFile.cc:51
pos
Definition: PixelAliasList.h:18
LocalCacheFile::image_
IOOffset image_
Definition: LocalCacheFile.h:38
Storage::SET
Definition: Storage.h:22
Storage::Relative
Relative
Definition: Storage.h:22
LocalCacheFile::closedFile_
bool closedFile_
Definition: LocalCacheFile.h:42
Storage.h
end
#define end
Definition: vmac.h:39
LocalCacheFile::present_
std::vector< char > present_
Definition: LocalCacheFile.h:39
edm::propagate_const
Definition: propagate_const.h:32
LocalCacheFile::close
void close(void) override
Definition: LocalCacheFile.cc:162
LocalCacheFile
Definition: LocalCacheFile.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LocalCacheFile::readv
IOSize readv(IOBuffer *into, IOSize n) override
Definition: LocalCacheFile.cc:116
LocalCacheFile::cacheTotal_
unsigned int cacheTotal_
Definition: LocalCacheFile.h:44
LocalCacheFile::resize
void resize(IOOffset size) override
Definition: LocalCacheFile.cc:158
LocalCacheFile::file_
edm::propagate_const< std::unique_ptr< File > > file_
Definition: LocalCacheFile.h:40
LocalCacheFile::storage_
edm::propagate_const< std::unique_ptr< Storage > > storage_
Definition: LocalCacheFile.h:41
IOBuffer
Definition: IOBuffer.h:7
LocalCacheFile::flush
void flush(void) override
Definition: LocalCacheFile.cc:160
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
LocalCacheFile::cacheCount_
unsigned int cacheCount_
Definition: LocalCacheFile.h:43
LocalCacheFile::write
IOSize write(const void *from, IOSize n) override
Definition: LocalCacheFile.cc:136
LocalCacheFile::writev
IOSize writev(const IOBuffer *from, IOSize n) override
Definition: LocalCacheFile.cc:146
Storage::position
virtual IOOffset position(void) const
Definition: Storage.cc:72
LocalCacheFile::prefetch
bool prefetch(const IOPosBuffer *what, IOSize n) override
Definition: LocalCacheFile.cc:169
LocalCacheFile::cache
void cache(IOOffset start, IOOffset end)
Definition: LocalCacheFile.cc:53
IOInput::read
int read(void)
Definition: IOInput.cc:52
IOPosBuffer
Definition: IOPosBuffer.h:7
LocalCacheFile::LocalCacheFile
LocalCacheFile(std::unique_ptr< Storage > base, const std::string &tmpdir="")
Definition: LocalCacheFile.cc:21
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
IOSize
size_t IOSize
Definition: IOTypes.h:14
Storage
Definition: Storage.h:20
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
File.h
Storage::write
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:44