Loading...
Searching...
No Matches
XrdOucCallBack Class Reference

`#include <XrdOucCallBack.hh>`

Inheritance diagram for XrdOucCallBack:
Collaboration diagram for XrdOucCallBack:

## Public Member Functions

| XrdOucCallBack ()
| ~XrdOucCallBack ()
void | Cancel ()
int | Init (XrdOucErrInfo *eInfo)
int | Reply (int retVal, int eValue, const char *eText, const char *Path=0)
Public Member Functions inherited from XrdOucEICB
| XrdOucEICB ()
| Constructor and destructor.
virtual | ~XrdOucEICB ()

## Static Public Member Functions

static int | Allowed (XrdOucErrInfo *eInfo)

## Public Attributes

XrdOucCallBack * | Next

## Detailed Description

Definition at line 46 of file XrdOucCallBack.hh.

## Constructor & Destructor Documentation

## XrdOucCallBack()

XrdOucCallBack::XrdOucCallBack | ( |  | ) |

inline

Definition at line 95 of file XrdOucCallBack.hh.

: Next(0), cbSync(0), cbArg(0), cbObj(0) {}
XrdOucCallBack::Next
XrdOucCallBack * Next
Definition XrdOucCallBack.hh:100

References Next.

## ~XrdOucCallBack()

XrdOucCallBack::~XrdOucCallBack | ( |  | ) |

inline

Definition at line 96 of file XrdOucCallBack.hh.

{if (cbObj) Cancel();}
XrdOucCallBack::Cancel
void Cancel()
Definition XrdOucCallBack.cc:38

References Cancel().

Here is the call graph for this function:

## Member Function Documentation

## Allowed()

int XrdOucCallBack::Allowed | ( | XrdOucErrInfo * | eInfo | ) |

inline static

Definition at line 57 of file XrdOucCallBack.hh.

{return eInfo->getErrCB() != 0;}
XrdOucErrInfo::getErrCB
XrdOucEICB * getErrCB()
Definition XrdOucErrInfo.hh:224

References XrdOucErrInfo::getErrCB().

Here is the call graph for this function:

## Cancel()

void XrdOucCallBack::Cancel | ( |  | ) |

Definition at line 38 of file XrdOucCallBack.cc.

{
// If a callback is outstanding, send a reply indicating that the operation
// should be retried.
//
if (cbObj) Reply(1, 0, "");
}
XrdOucCallBack::Reply
int Reply(int retVal, int eValue, const char *eText, const char *Path=0)
Definition XrdOucCallBack.cc:81

References Reply().

Referenced by ~XrdOucCallBack().

Here is the call graph for this function:
Here is the caller graph for this function:

## Init()

int XrdOucCallBack::Init | ( | XrdOucErrInfo * | eInfo | ) |

Definition at line 51 of file XrdOucCallBack.cc.

{
const char *theUser;
// Make sure we can do a callback here
//
if (cbObj || eInfo->getErrCB() == 0) return 0;
// Copy relevant data
//
if ((theUser = eInfo->getErrUser())) strlcpy(UserID,theUser,sizeof(UserID));
else strcpy(UserID, "???");
cbObj = eInfo->getErrCB(cbArg);
// Now set the callback object in the input ErrInfo object to be ours so
// that we can make sure that the wait for callback response was sent
// before we actually effect a reply.
//
eInfo->setErrCB(this, cbArg);
// All done
//
return 1;
}
strlcpy
size_t strlcpy(char *dst, const char *src, size_t sz)
Definition XrdSysPlatform.cc:60
XrdOucErrInfo::getErrUser
const char * getErrUser()
Definition XrdOucErrInfo.hh:297
XrdOucErrInfo::setErrCB
void setErrCB(XrdOucEICB *cb, unsigned long long cbarg=0)
Definition XrdOucErrInfo.hh:125

References XrdOucErrInfo::getErrCB(), XrdOucErrInfo::getErrUser(), XrdOucErrInfo::setErrCB(), and strlcpy().

Here is the call graph for this function:

## Reply()

int XrdOucCallBack::Reply | ( | int | retVal,
|  | int | eValue,
|  | const char * | eText,
|  | const char * | Path = 0 )

Definition at line 81 of file XrdOucCallBack.cc.

{
XrdOucErrInfo cbInfo(UserID, this, cbArg);
XrdOucEICB *objCB;
// Verify that we can actually do a callback
//
if (!(objCB = cbObj)) return 0;
cbObj = 0;
// Wait for the semaphore to make sure the "wait for callback" response was
// actually sent to preserve time causality.
//
cbSync.Wait();
// Send the reply using the constructed ErrInfo object and then wait until we
// know that the response was actually sent to allow this object to be deleted.
//
cbInfo.setErrInfo(eValue, (eText ? eText : ""));
objCB->Done(retVal, &cbInfo, Path);
cbSync.Wait();
// All done
//
return 1;
}
Path
XrdOucString Path
Definition XrdSecpwdSrvAdmin.cc:160
XrdOucEICB::Done
virtual void Done(int &Result, XrdOucErrInfo *eInfo, const char *Path=0)=0
XrdOucEICB::XrdOucEICB
XrdOucEICB()
Constructor and destructor.
Definition XrdOucErrInfo.hh:522

References XrdOucEICB::XrdOucEICB(), XrdOucEICB::Done(), Path, and XrdOucErrInfo::setErrInfo().

Referenced by Cancel(), and XrdOfsTPCInfo::Reply().

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## Next

XrdOucCallBack* XrdOucCallBack::Next

Definition at line 100 of file XrdOucCallBack.hh.

Referenced by XrdOucCallBack().

The documentation for this class was generated from the following files:

- XrdOucCallBack.hh
- XrdOucCallBack.cc