TrkErrCode Class Reference

#include <TrkErrCode.h>

List of all members.

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 &)
TrkErrCodeoperator= (const TrkErrCode &)
int failure () const
int success () const
const std::stringmessage () 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


Detailed Description

Definition at line 48 of file TrkErrCode.h.


Member Enumeration Documentation

enum TrkErrCode::TrkSuccess

Enumerator:
fail 
succeed 

Definition at line 51 of file TrkErrCode.h.

00051 {fail,succeed};


Constructor & Destructor Documentation

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 (  ) 

Definition at line 48 of file TrkErrCode.cxx.

References _string.

00048                         {
00049   if (_string != 0) {
00050     delete _string;
00051     _string = 0;
00052   }
00053 }

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 }


Member Function Documentation

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]

Definition at line 63 of file TrkErrCode.h.

References _nullStr, and _string.

00064   {
00065     return (_string != 0) ? *_string : _nullStr; 
00066   }

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

Referenced by MdcTrackList::finishCircle(), MdcTrackList::finishHelix(), TrkHelixFitter::fit(), MdcxTrackFinder::FitMdcxTrack(), and operator<<().

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;}


Member Data Documentation

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]

Definition at line 95 of file TrkErrCode.h.

Referenced by message().

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().


Generated on Tue Nov 29 23:36:13 2016 for BOSS_7.0.2 by  doxygen 1.4.7