XRootD
XrdSsiErrInfo Class Reference

#include <XrdSsiErrInfo.hh>

+ Collaboration diagram for XrdSsiErrInfo:

Public Member Functions

 XrdSsiErrInfo ()
 Constructor and Destructor. More...
 
 XrdSsiErrInfo (XrdSsiErrInfo const &oP)
 Copy constructor. More...
 
 ~XrdSsiErrInfo ()
 
void Clr ()
 Reset and clear error information. More...
 
const std::string & Get () const
 
const std::string & Get (int &eNum) const
 
int GetArg () const
 
bool hasError () const
 
bool isOK () const
 
XrdSsiErrInfooperator= (XrdSsiErrInfo const &rhs)
 Assignment operator. More...
 
void Set (const char *eMsg=0, int eNum=0, int eArg=0)
 
void Set (const std::string &eMsg, int eNum=0, int eArg=0)
 

Detailed Description

The XrdSsiErrInfo object is used to hold error information for many ssi client-oriented requests.

Definition at line 40 of file XrdSsiErrInfo.hh.

Constructor & Destructor Documentation

◆ XrdSsiErrInfo() [1/2]

XrdSsiErrInfo::XrdSsiErrInfo ( XrdSsiErrInfo const &  oP)
inline

Copy constructor.

Definition at line 128 of file XrdSsiErrInfo.hh.

129  {Set(oP.errText, oP.errNum, oP.errArg);}
void Set(const char *eMsg=0, int eNum=0, int eArg=0)

References Set().

+ Here is the call graph for this function:

◆ XrdSsiErrInfo() [2/2]

XrdSsiErrInfo::XrdSsiErrInfo ( )
inline

Constructor and Destructor.

Definition at line 135 of file XrdSsiErrInfo.hh.

135 : errNum(0), errArg(0) {}

◆ ~XrdSsiErrInfo()

XrdSsiErrInfo::~XrdSsiErrInfo ( )
inline

Definition at line 137 of file XrdSsiErrInfo.hh.

137 {}

Member Function Documentation

◆ Clr()

void XrdSsiErrInfo::Clr ( )
inline

Reset and clear error information.

Definition at line 48 of file XrdSsiErrInfo.hh.

48 {errText.clear(); errArg = errNum = 0;}

Referenced by XrdSsiResponder::BindRequest().

+ Here is the caller graph for this function:

◆ Get() [1/2]

const std::string& XrdSsiErrInfo::Get ( ) const
inline

Get current error text.

Returns
The error text.

Definition at line 68 of file XrdSsiErrInfo.hh.

68 {return errText;}

◆ Get() [2/2]

const std::string& XrdSsiErrInfo::Get ( int &  eNum) const
inline

Get current error information.

Parameters
eNumplace where the error number is to be placed.
Returns
The error text and the error number value.

Definition at line 59 of file XrdSsiErrInfo.hh.

59 {eNum = errNum; return errText;}

Referenced by XrdSsiFileSess::open(), and XrdSsiResponder::SetErrResponse().

+ Here is the caller graph for this function:

◆ GetArg()

int XrdSsiErrInfo::GetArg ( ) const
inline

Get current error argument.

Returns
the error argument value.

Definition at line 76 of file XrdSsiErrInfo.hh.

76 {return errArg;}

Referenced by XrdSsiFileSess::open().

+ Here is the caller graph for this function:

◆ hasError()

bool XrdSsiErrInfo::hasError ( ) const
inline

Check if there is an error.

Returns
True if an error exists and false otherwise.

Definition at line 84 of file XrdSsiErrInfo.hh.

84 {return errNum != 0;}

◆ isOK()

bool XrdSsiErrInfo::isOK ( ) const
inline

Check if there is no error.

Returns
True if no error exists and false otherwise.

Definition at line 92 of file XrdSsiErrInfo.hh.

92 {return errNum == 0;}

◆ operator=()

XrdSsiErrInfo& XrdSsiErrInfo::operator= ( XrdSsiErrInfo const &  rhs)
inline

Assignment operator.

Definition at line 119 of file XrdSsiErrInfo.hh.

120  {if (&rhs != this) Set(rhs.errText, rhs.errNum, rhs.errArg);
121  return *this;
122  }

References Set().

+ Here is the call graph for this function:

◆ Set() [1/2]

void XrdSsiErrInfo::Set ( const char *  eMsg = 0,
int  eNum = 0,
int  eArg = 0 
)
inline

Set new error information. There are two obvious variations.

Parameters
eMsgpointer to a string describing the error. If nil, the eNum is taken as errno and converted to corresponding description.
eNumthe error number associated with the error.
eArgthe error argument, if any (see XrdSsiService::Provision()).

Definition at line 103 of file XrdSsiErrInfo.hh.

104  {errText = (eMsg && *eMsg ? eMsg : Errno2Text(eNum));
105  errNum = eNum;
106  errArg = eArg;
107  }
#define eMsg(x)

References eMsg.

Referenced by XrdSsiErrInfo(), XrdSsiStream::GetBuff(), XrdSsiRequest::GetResponseData(), XrdSsiClientProvider::GetService(), XrdSsiProvider::GetService(), operator=(), XrdSsiService::Prepare(), XrdSsiStream::SetBuff(), XrdSsiTaskReal::SetBuff(), XrdSsiClientProvider::SetConfig(), XrdSsiUtils::SetErr(), XrdSsiResponder::SetErrResponse(), and XrdSsiTaskReal::XeqEvent().

+ Here is the caller graph for this function:

◆ Set() [2/2]

void XrdSsiErrInfo::Set ( const std::string &  eMsg,
int  eNum = 0,
int  eArg = 0 
)
inline

Definition at line 109 of file XrdSsiErrInfo.hh.

110  {errText = (eMsg.empty() ? Errno2Text(eNum) : eMsg);
111  errNum = eNum;
112  errArg = eArg;
113  }

References eMsg.


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