CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/Utilities/DCacheAdaptor/interface/DCacheFile.h

Go to the documentation of this file.
00001 #ifndef DCACHE_ADAPTOR_DCACHE_FILE_H
00002 # define DCACHE_ADAPTOR_DCACHE_FILE_H
00003 
00004 # include "Utilities/StorageFactory/interface/Storage.h"
00005 # include "Utilities/StorageFactory/interface/IOFlags.h"
00006 # include <string>
00007 
00008 class DCacheFile : public Storage
00009 {
00010 public:
00011   DCacheFile (void);
00012   DCacheFile (IOFD fd);
00013   DCacheFile (const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
00014   DCacheFile (const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
00015   ~DCacheFile (void);
00016 
00017   virtual void  create (const char *name,
00018                         bool exclusive = false,
00019                         int perms = 0666);
00020   virtual void  create (const std::string &name,
00021                         bool exclusive = false,
00022                         int perms = 0666);
00023   virtual void  open (const char *name,
00024                       int flags = IOFlags::OpenRead,
00025                       int perms = 0666);
00026   virtual void  open (const std::string &name,
00027                       int flags = IOFlags::OpenRead,
00028                       int perms = 0666);
00029 
00030   using Storage::read;
00031   using Storage::write;
00032   using Storage::position;
00033 
00034   virtual IOSize        read (void *into, IOSize n);
00035   virtual IOSize        readv (IOBuffer *into, IOSize buffers);
00036   virtual IOSize        readv (IOPosBuffer *into, IOSize buffers);
00037   virtual IOSize        write (const void *from, IOSize n);
00038 
00039   virtual IOOffset      position (IOOffset offset, Relative whence = SET);
00040   virtual void          resize (IOOffset size);
00041 
00042   virtual void          close (void);
00043   virtual void          abort (void);
00044 
00045 private:
00046   IOFD                  m_fd;
00047   bool                  m_close;
00048   std::string           m_name;
00049 };
00050 
00051 #endif // DCACHE_ADAPTOR_DCACHE_FILE_H