CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/Utilities/StorageFactory/interface/StorageAccountProxy.h

Go to the documentation of this file.
00001 #ifndef STORAGE_FACTORY_STORAGE_ACCOUNT_PROXY_H
00002 # define STORAGE_FACTORY_STORAGE_ACCOUNT_PROXY_H
00003 
00004 # include "Utilities/StorageFactory/interface/StorageAccount.h"
00005 # include "Utilities/StorageFactory/interface/Storage.h"
00006 # include <string>
00007 
00016 class StorageAccountProxy : public Storage
00017 {
00018 public:
00019   StorageAccountProxy (const std::string &storageClass, Storage *baseStorage);
00020   ~StorageAccountProxy (void);
00021 
00022   using Storage::read;
00023   using Storage::write;
00024 
00025   virtual bool          prefetch (const IOPosBuffer *what, IOSize n);
00026   virtual IOSize        read (void *into, IOSize n);
00027   virtual IOSize        read (void *into, IOSize n, IOOffset pos);
00028   virtual IOSize        readv (IOBuffer *into, IOSize n);
00029   virtual IOSize        readv (IOPosBuffer *into, IOSize n);
00030   virtual IOSize        write (const void *from, IOSize n);
00031   virtual IOSize        write (const void *from, IOSize n, IOOffset pos);
00032   virtual IOSize        writev (const IOBuffer *from, IOSize n);
00033   virtual IOSize        writev (const IOPosBuffer *from, IOSize n);
00034 
00035   virtual IOOffset      position (IOOffset offset, Relative whence = SET);
00036   virtual void          resize (IOOffset size);
00037   virtual void          flush (void);
00038   virtual void          close (void);
00039 
00040 protected:
00041   std::string           m_storageClass;
00042   Storage               *m_baseStorage;
00043 
00044   StorageAccount::Counter &m_statsRead;
00045   StorageAccount::Counter &m_statsReadV;
00046   StorageAccount::Counter &m_statsWrite;
00047   StorageAccount::Counter &m_statsWriteV;
00048   StorageAccount::Counter &m_statsPosition;
00049   StorageAccount::Counter &m_statsPrefetch;
00050 };
00051 
00052 #endif // STORAGE_FACTORY_STORAGE_ACCOUNT_PROXY_H