BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkErrCode Class Reference

#include <TrkErrCode.h>

Public Types

enum  TrkSuccess { fail , succeed , fail , succeed }
 
enum  TrkSuccess { fail , succeed , 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::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)
 
 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::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)
 

Detailed Description

Member Enumeration Documentation

◆ TrkSuccess [1/2]

◆ TrkSuccess [2/2]

Enumerator
fail 
succeed 
fail 
succeed 

Definition at line 51 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

Constructor & Destructor Documentation

◆ TrkErrCode() [1/4]

TrkErrCode::TrkErrCode ( TrkSuccess  succ = succeed,
int  code = 1,
const char *  str = 0 
)

Definition at line 23 of file TrkErrCode.cxx.

24 : _string(0)
25{
26 setMessage(str);
27 if (succ) {
28 _failure = 0; _success = code;
29 } else {
30 _success = 0; _failure = code;
31 }
32}

◆ ~TrkErrCode() [1/2]

TrkErrCode::~TrkErrCode ( )

Definition at line 48 of file TrkErrCode.cxx.

48 {
49 if (_string != 0) {
50 delete _string;
51 _string = 0;
52 }
53}

◆ TrkErrCode() [2/4]

TrkErrCode::TrkErrCode ( const TrkErrCode theCode)

Definition at line 35 of file TrkErrCode.cxx.

36 : _failure(theCode._failure)
37 , _success(theCode._success)
38{
39 if (theCode._string != 0) {
40 _string = new std::string(*theCode._string);
41 }
42 else {
43 _string = 0;
44 }
45}

◆ TrkErrCode() [3/4]

TrkErrCode::TrkErrCode ( TrkSuccess  = succeed,
int  code = 1,
const char *  str = 0 
)

◆ ~TrkErrCode() [2/2]

TrkErrCode::~TrkErrCode ( )

◆ TrkErrCode() [4/4]

TrkErrCode::TrkErrCode ( const TrkErrCode )

Member Function Documentation

◆ failure() [1/2]

◆ failure() [2/2]

int TrkErrCode::failure ( ) const
inline

Definition at line 61 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

61{return _failure;}

◆ message() [1/2]

const std::string & TrkErrCode::message ( ) const
inline

Definition at line 63 of file InstallArea/include/TrkBase/TrkBase/TrkErrCode.h.

64 {
65 return (_string != 0) ? *_string : _nullStr;
66 }

◆ message() [2/2]

const std::string & TrkErrCode::message ( ) const
inline

Definition at line 63 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

64 {
65 return (_string != 0) ? *_string : _nullStr;
66 }

◆ operator=() [1/2]

TrkErrCode & TrkErrCode::operator= ( const TrkErrCode theCode)

Definition at line 56 of file TrkErrCode.cxx.

57{
58 _failure = theCode._failure;
59 _success = theCode._success;
60
61 if (theCode._string != 0) {
62 if (_string != 0) {
63 *_string = *theCode._string;
64 }
65 else {
66 _string = new std::string(*theCode._string);
67 }
68 }
69 else {
70 if (_string != 0) delete _string;
71 _string = 0;
72 }
73
74 return *this;
75}

◆ operator=() [2/2]

TrkErrCode & TrkErrCode::operator= ( const TrkErrCode )

◆ print() [1/2]

void TrkErrCode::print ( std::ostream &  ostr) const

◆ print() [2/2]

void TrkErrCode::print ( std::ostream &  ostr) const

◆ setFailure() [1/2]

void TrkErrCode::setFailure ( int  i,
const char *  str = 0 
)
inline

Definition at line 79 of file InstallArea/include/TrkBase/TrkBase/TrkErrCode.h.

80 {
81 setMessage(str);
82 _failure=(i==0?1:i); _success=0;
83 }

Referenced by TrkHelixFitter::fit(), TrkPocaBase::minimize(), TrkPocaBase::stepToPointPoca(), and TrkPocaXY::TrkPocaXY().

◆ setFailure() [2/2]

void TrkErrCode::setFailure ( int  i,
const char *  str = 0 
)
inline

Definition at line 79 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

80 {
81 setMessage(str);
82 _failure=(i==0?1:i); _success=0;
83 }

◆ setMessage() [1/2]

void TrkErrCode::setMessage ( const char *  str = 0)
inline

Definition at line 70 of file InstallArea/include/TrkBase/TrkBase/TrkErrCode.h.

70 {
71 if (_string != 0) delete _string;
72 if (str != 0) {
73 _string= new std::string(str);
74 }
75 else {
76 _string = 0;
77 }
78 }

Referenced by setFailure(), setSuccess(), and TrkErrCode().

◆ setMessage() [2/2]

void TrkErrCode::setMessage ( const char *  str = 0)
inline

Definition at line 70 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

70 {
71 if (_string != 0) delete _string;
72 if (str != 0) {
73 _string= new std::string(str);
74 }
75 else {
76 _string = 0;
77 }
78 }

◆ setSuccess() [1/2]

void TrkErrCode::setSuccess ( int  i,
const char *  str = 0 
)
inline

Definition at line 84 of file InstallArea/include/TrkBase/TrkBase/TrkErrCode.h.

84 {
85 setMessage(str);
86 _success=(i==0?1:i); _failure=0;
87 }

Referenced by TrkHelixFitter::fit(), TrkPocaBase::minimize(), TrkPocaBase::stepTowardPoca(), and TrkPocaXY::TrkPocaXY().

◆ setSuccess() [2/2]

void TrkErrCode::setSuccess ( int  i,
const char *  str = 0 
)
inline

Definition at line 84 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

84 {
85 setMessage(str);
86 _success=(i==0?1:i); _failure=0;
87 }

◆ success() [1/2]

◆ success() [2/2]

int TrkErrCode::success ( ) const
inline

Definition at line 62 of file Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkErrCode.h.

62{return _success;}

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