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 {
14 public:
15  LocalCacheFile (std::unique_ptr<Storage> base, const std::string &tmpdir = "");
16  ~LocalCacheFile (void);
17 
18  using Storage::read;
19  using Storage::write;
20 
21  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
22  virtual IOSize read (void *into, IOSize n);
23  virtual IOSize read (void *into, IOSize n, IOOffset pos);
24  virtual IOSize readv (IOBuffer *into, IOSize n);
25  virtual IOSize readv (IOPosBuffer *into, IOSize n);
26  virtual IOSize write (const void *from, IOSize n);
27  virtual IOSize write (const void *from, IOSize n, IOOffset pos);
28  virtual IOSize writev (const IOBuffer *from, IOSize n);
29  virtual IOSize writev (const IOPosBuffer *from, IOSize n);
30 
31  virtual IOOffset position (IOOffset offset, Relative whence = SET);
32  virtual void resize (IOOffset size);
33  virtual void flush (void);
34  virtual void close (void);
35 
36 private:
38 
40  std::vector<char> present_;
44  unsigned int cacheCount_;
45  unsigned int cacheTotal_;
46 };
47 
48 #endif // STORAGE_FACTORY_LOCAL_CACHE_FILE_H
Definition: start.py:1
void cache(IOOffset start, IOOffset end)
unsigned int cacheTotal_
virtual void flush(void)
virtual void close(void)
edm::propagate_const< std::unique_ptr< Storage > > storage_
Relative
Definition: Storage.h:23
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
unsigned int cacheCount_
virtual IOOffset position(void) const
Definition: Storage.cc:95
#define end
Definition: vmac.h:37
base
Make Sure CMSSW is Setup ##.
virtual IOSize writev(const IOBuffer *from, IOSize n)
int read(void)
Definition: IOInput.cc:54
std::vector< char > present_
virtual IOSize write(const void *from, IOSize n)
virtual IOOffset size(void) const
Definition: Storage.cc:102
LocalCacheFile(std::unique_ptr< Storage > base, const std::string &tmpdir="")
virtual IOSize readv(IOBuffer *into, IOSize n)
int64_t IOOffset
Definition: IOTypes.h:19
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
edm::propagate_const< std::unique_ptr< File > > file_
virtual void resize(IOOffset size)
size_t IOSize
Definition: IOTypes.h:14