CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/Utilities/XrdAdaptor/src/XrdFile.h

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