1#ifndef __XRDPOSIXPREPIO_HH__
2#define __XRDPOSIXPREPIO_HH__
48 {
return (Init() ? fileP->Fcntl(opc, args, resp) : openRC);}
50long long FSize() {
return (Init() ? fileP->FSize() : openRC);}
53 {
return (Init() ? fileP->Fstat(buf) : openRC);}
55int Open() {Init();
return openRC;}
57const char *
Path() {
return fileP->Path();}
59int Read (
char *Buffer,
long long Offset,
int Length)
60 {
return (Init() ? fileP->Read(Buffer, Offset, Length) : openRC);}
63 {
if (Init(&iocb)) fileP->Read(iocb, buff, offs, rlen);
64 else iocb.
Done(openRC);
68 {
return (Init() ? fileP->ReadV(readV, n) : openRC);}
71 {
if (Init(&iocb)) fileP->ReadV(iocb, readV, rnum);
72 else iocb.
Done(openRC);
75int Sync() {
return (Init() ? fileP->Sync() : openRC);}
78 {
if (Init(&iocb)) fileP->Sync(iocb);
79 else iocb.
Done(openRC);
83 {
return (Init() ? fileP->Trunc(Offset) : openRC);}
85int Write(
char *Buffer,
long long Offset,
int Length)
86 {
return (Init() ? fileP->Write(Buffer,Offset,Length) : openRC);}
89 {
if (Init(&iocb)) fileP->Write(iocb, buff, offs, wlen);
90 else iocb.
Done(openRC);
95 : fileP(fP), openRC(0), iCalls(0),
96 clFlags(clflags), clMode(clmode) {}
virtual void Done(int result)=0
XrdOucCacheIO()
Construct and Destructor.
int ReadV(const XrdOucIOVec *readV, int n)
int Read(char *Buffer, long long Offset, int Length)
int Write(char *Buffer, long long Offset, int Length)
bool Detach(XrdOucCacheIOCD &cdP)
void Sync(XrdOucCacheIOCB &iocb)
int Fcntl(XrdOucCacheOp::Code opc, const std::string &args, std::string &resp)
void Write(XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
void Read(XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
int Trunc(long long Offset)
XrdPosixPrepIO(XrdPosixFile *fP, XrdCl::OpenFlags::Flags clflags, XrdCl::Access::Mode clmode)
virtual ~XrdPosixPrepIO()
void ReadV(XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum)
int Fstat(struct stat &buf)
Flags
Open flags, may be or'd when appropriate.