• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdPss.hh

Go to the documentation of this file.
00001 #ifndef _XRDPSS_API_H
00002 #define _XRDPSS_API_H
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                             X r d P s s . h h                              */
00006 /*                                                                            */
00007 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC03-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012 
00013 //         $Id: XrdPss.hh,v 1.7 2009/05/22 01:06:53 abh Exp $
00014 
00015 #include <sys/types.h>
00016 #include <errno.h>
00017 #include "XrdSys/XrdSysHeaders.hh"
00018 
00019 #include "XrdOss/XrdOss.hh"
00020 
00021 /******************************************************************************/
00022 /*                             X r d P s s D i r                              */
00023 /******************************************************************************/
00024 
00025 class XrdPssDir : public XrdOssDF
00026 {
00027 public:
00028 int     Close(long long *retsz=0);
00029 int     Opendir(const char *);
00030 int     Readdir(char *buff, int blen);
00031 
00032         // Constructor and destructor
00033         XrdPssDir(const char *tid) 
00034                  {lclfd=0; ateof=0; tident=tid;}
00035        ~XrdPssDir() {if (lclfd) Close();}
00036 private:
00037          DIR       *lclfd;
00038 const    char      *tident;
00039          int        ateof;
00040 };
00041   
00042 /******************************************************************************/
00043 /*                            X r d P s s F i l e                             */
00044 /******************************************************************************/
00045 
00046 class XrdSfsAio;
00047   
00048 class XrdPssFile : public XrdOssDF
00049 {
00050 public:
00051 
00052 // The following two are virtual functions to allow for upcasting derivations
00053 // of this implementation
00054 //
00055 virtual int     Close(long long *retsz=0);
00056 virtual int     Open(const char *, int, mode_t, XrdOucEnv &);
00057 
00058 int     Fstat(struct stat *);
00059 int     Fsync();
00060 int     Fsync(XrdSfsAio *aiop);
00061 int     Ftruncate(unsigned long long);
00062 off_t   getMmap(void **addr);
00063 int     isCompressed(char *cxidp=0);
00064 ssize_t Read(               off_t, size_t);
00065 ssize_t Read(       void *, off_t, size_t);
00066 int     Read(XrdSfsAio *aiop);
00067 ssize_t ReadRaw(    void *, off_t, size_t);
00068 ssize_t Write(const void *, off_t, size_t);
00069 int     Write(XrdSfsAio *aiop);
00070  
00071          // Constructor and destructor
00072          XrdPssFile(const char *tid) {fd = -1; tident = tid;}
00073 
00074 virtual ~XrdPssFile() {if (fd >= 0) Close();}
00075 
00076 private:
00077 
00078 const char *tident;
00079 const char *crPath;
00080       int   crOpts;
00081 };
00082 
00083 /******************************************************************************/
00084 /*                             X r d P s s S y s                              */
00085 /******************************************************************************/
00086   
00087 class XrdOucEnv;
00088 class XrdSysError;
00089 class XrdOucStream;
00090 class XrdOucTList;
00091 
00092 class XrdPssSys : public XrdOss
00093 {
00094 public:
00095 virtual XrdOssDF *newDir(const char *tident)
00096                        {return (XrdOssDF *)new XrdPssDir(tident);}
00097 virtual XrdOssDF *newFile(const char *tident)
00098                        {return (XrdOssDF *)new XrdPssFile(tident);}
00099 
00100 int       Chmod(const char *, mode_t mode);
00101 virtual
00102 int       Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0);
00103 int       Init(XrdSysLogger *, const char *);
00104 int       Mkdir(const char *, mode_t mode, int mkpath=0);
00105 int       Remdir(const char *, int Opts=0);
00106 int       Rename(const char *, const char *);
00107 int       Stat(const char *, struct stat *, int resonly=0);
00108 int       Truncate(const char *, unsigned long long);
00109 int       Unlink(const char *, int Opts=0);
00110 
00111 static int P2URL(char *pbuff,int pblen,const char *path,XrdOucEnv *env=0);
00112 
00113 static char        *ConfigFN;       // -> Pointer to the config file name
00114 static char        *myHost;
00115 static char        *myName;
00116 static XrdOucTList *PanList;
00117 static char        *hdrData;
00118 static char         hdrLen;
00119 static long         rdAheadSz;
00120 static long         rdCacheSz;
00121 static long         numStream;
00122    
00123          XrdPssSys() {}
00124 virtual ~XrdPssSys() {}
00125 
00126 private:
00127 
00128 int    buildHdr();
00129 int    Configure(const char *);
00130 int    ConfigProc(const char *ConfigFN);
00131 int    ConfigXeq(char*, XrdOucStream&);
00132 int    xmang(XrdSysError *errp,   XrdOucStream &Config);
00133 int    xsopt(XrdSysError *Eroute, XrdOucStream &Config);
00134 int    xtrac(XrdSysError *Eroute, XrdOucStream &Config);
00135 };
00136 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1