#include <TrkErrCode.h>
Public Types | |
fail | |
succeed | |
enum | TrkSuccess { fail, succeed } |
Public Member Functions | |
TrkErrCode (TrkSuccess=succeed, int code=1, const char *str=0) | |
~TrkErrCode () | |
TrkErrCode (const TrkErrCode &) | |
TrkErrCode & | operator= (const TrkErrCode &) |
int | failure () const |
int | success () const |
const std::string & | message () const |
void | print (std::ostream &ostr) const |
void | setMessage (const char *str=0) |
void | setFailure (int i, const char *str=0) |
void | setSuccess (int i, const char *str=0) |
Private Attributes | |
int | _failure |
int | _success |
std::string * | _string |
Static Private Attributes | |
static std::string | _nullStr |
Definition at line 48 of file TrkErrCode.h.
TrkErrCode::TrkErrCode | ( | TrkSuccess | = succeed , |
|
int | code = 1 , |
|||
const char * | str = 0 | |||
) |
Definition at line 23 of file TrkErrCode.cxx.
References _failure, _success, and setMessage().
00024 : _string(0) 00025 { 00026 setMessage(str); 00027 if (succ) { 00028 _failure = 0; _success = code; 00029 } else { 00030 _success = 0; _failure = code; 00031 } 00032 }
TrkErrCode::~TrkErrCode | ( | ) |
TrkErrCode::TrkErrCode | ( | const TrkErrCode & | ) |
Definition at line 35 of file TrkErrCode.cxx.
References _string, and deljobs::string.
00036 : _failure(theCode._failure) 00037 , _success(theCode._success) 00038 { 00039 if (theCode._string != 0) { 00040 _string = new std::string(*theCode._string); 00041 } 00042 else { 00043 _string = 0; 00044 } 00045 }
int TrkErrCode::failure | ( | ) | const [inline] |
Definition at line 61 of file TrkErrCode.h.
References _failure.
Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), MdcHoughFinder::execute(), HoughValidUpdate::execute(), MdcTrackList::finishCircle(), MdcTrackList::finishHelix(), TrkHelixFitter::fit(), TrkHitOnTrk::getFitStuff(), TrkDifPieceTraj::prepend(), TrkHelixRep::resid(), TrkDifPieceTraj::TrkDifPieceTraj(), TrkPocaXY::TrkPocaXY(), and TrkHitOnTrk::updatePoca().
00061 {return _failure;}
const std::string& TrkErrCode::message | ( | ) | const [inline] |
TrkErrCode & TrkErrCode::operator= | ( | const TrkErrCode & | ) |
Definition at line 56 of file TrkErrCode.cxx.
References _failure, _string, _success, and deljobs::string.
00057 { 00058 _failure = theCode._failure; 00059 _success = theCode._success; 00060 00061 if (theCode._string != 0) { 00062 if (_string != 0) { 00063 *_string = *theCode._string; 00064 } 00065 else { 00066 _string = new std::string(*theCode._string); 00067 } 00068 } 00069 else { 00070 if (_string != 0) delete _string; 00071 _string = 0; 00072 } 00073 00074 return *this; 00075 }
void TrkErrCode::print | ( | std::ostream & | ostr | ) | const |
void TrkErrCode::setFailure | ( | int | i, | |
const char * | str = 0 | |||
) | [inline] |
Definition at line 79 of file TrkErrCode.h.
References _failure, _success, and setMessage().
Referenced by TrkDifPoca::calcDist(), TrkHelixFitter::fit(), TrkPocaXY::interLineCircle(), TrkPocaBase::minimize(), TrkPocaBase::stepToPointPoca(), and TrkPocaXY::TrkPocaXY().
00080 { 00081 setMessage(str); 00082 _failure=(i==0?1:i); _success=0; 00083 }
void TrkErrCode::setMessage | ( | const char * | str = 0 |
) | [inline] |
Definition at line 70 of file TrkErrCode.h.
References _string, and deljobs::string.
Referenced by setFailure(), setSuccess(), and TrkErrCode().
00070 { 00071 if (_string != 0) delete _string; 00072 if (str != 0) { 00073 _string= new std::string(str); 00074 } 00075 else { 00076 _string = 0; 00077 } 00078 }
void TrkErrCode::setSuccess | ( | int | i, | |
const char * | str = 0 | |||
) | [inline] |
Definition at line 84 of file TrkErrCode.h.
References _failure, _success, and setMessage().
Referenced by TrkDifPoca::calcDist(), TrkHelixFitter::fit(), TrkPocaBase::minimize(), TrkPocaBase::stepTowardPoca(), and TrkPocaXY::TrkPocaXY().
00084 { 00085 setMessage(str); 00086 _success=(i==0?1:i); _failure=0; 00087 }
int TrkErrCode::success | ( | ) | const [inline] |
Definition at line 62 of file TrkErrCode.h.
References _success.
Referenced by TrkDifPieceTraj::append(), MdcHitOnTrack::dcaToWire(), MdcTrackListCsmc::finish3d(), MdcTrackList::finishHelix(), TrkHelixFitter::fit(), MdcxTrackFinder::FitMdcxTrack(), TrkDifPieceTraj::prepend(), TrkPocaXY::TrkPocaXY(), and TrkBmSpotOnTrk::updateMeasurement().
00062 {return _success;}
int TrkErrCode::_failure [private] |
Definition at line 92 of file TrkErrCode.h.
Referenced by failure(), operator=(), setFailure(), setSuccess(), and TrkErrCode().
std::string TrkErrCode::_nullStr [static, private] |
std::string* TrkErrCode::_string [private] |
Definition at line 94 of file TrkErrCode.h.
Referenced by message(), operator=(), setMessage(), TrkErrCode(), and ~TrkErrCode().
int TrkErrCode::_success [private] |
Definition at line 93 of file TrkErrCode.h.
Referenced by operator=(), setFailure(), setSuccess(), success(), and TrkErrCode().