CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
6 # include <vector>
7 # include <string>
8 # include <memory>
9 
11 class LocalCacheFile : public Storage
12 {
13 public:
14  LocalCacheFile (std::unique_ptr<Storage> base, const std::string &tmpdir = "");
15  ~LocalCacheFile (void);
16 
17  using Storage::read;
18  using Storage::write;
19 
20  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
21  virtual IOSize read (void *into, IOSize n);
22  virtual IOSize read (void *into, IOSize n, IOOffset pos);
23  virtual IOSize readv (IOBuffer *into, IOSize n);
24  virtual IOSize readv (IOPosBuffer *into, IOSize n);
25  virtual IOSize write (const void *from, IOSize n);
26  virtual IOSize write (const void *from, IOSize n, IOOffset pos);
27  virtual IOSize writev (const IOBuffer *from, IOSize n);
28  virtual IOSize writev (const IOPosBuffer *from, IOSize n);
29 
30  virtual IOOffset position (IOOffset offset, Relative whence = SET);
31  virtual void resize (IOOffset size);
32  virtual void flush (void);
33  virtual void close (void);
34 
35 private:
37 
39  std::vector<char> present_;
40  std::unique_ptr<File> file_;
41  std::unique_ptr<Storage> storage_;
43  unsigned int cacheCount_;
44  unsigned int cacheTotal_;
45 };
46 
47 #endif // STORAGE_FACTORY_LOCAL_CACHE_FILE_H
tuple base
Main Program
Definition: newFWLiteAna.py:92
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
void cache(IOOffset start, IOOffset end)
unsigned int cacheTotal_
virtual void flush(void)
virtual void close(void)
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
virtual IOSize writev(const IOBuffer *from, IOSize n)
int read(void)
Definition: IOInput.cc:54
std::vector< char > present_
std::unique_ptr< Storage > storage_
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
std::unique_ptr< File > file_
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual void resize(IOOffset size)
size_t IOSize
Definition: IOTypes.h:14