Cat
StatusCode.h
Go to the documentation of this file.
1 // $Id: StatusCode.h,v 1.3 2002/09/27 16:39:30 mato Exp $
2 #ifndef STATUSCODES_H
3 #define STATUSCODES_H
4 
5 
16 class StatusCode {
17 public:
18  enum Type {
19  FAILURE = 0,
20  SUCCESS = 1
21  };
22 
24  StatusCode( unsigned long code = SUCCESS );
25 
29  bool isSuccess() const;
30 
36  bool isFailure() const;
37 /*
39  unsigned long getCode() const;
40 
42  void setCode( unsigned long );
43 
45  operator unsigned long() const;
46 */
48  StatusCode& operator=(unsigned long value);
49 /*
51  friend bool operator< ( const StatusCode& a, const StatusCode& b );
52 
54  friend bool operator> ( const StatusCode& a, const StatusCode& b );
55 */
56 protected:
58  unsigned long d_code;
59 };
60 
61 inline StatusCode::StatusCode( unsigned long code ) : d_code(code) {
62 }
63 
64 inline bool StatusCode::isSuccess() const {
65  return (d_code == SUCCESS );
66 }
67 
68 inline bool StatusCode::isFailure() const {
69  return (d_code != SUCCESS );
70 }
71 /*
72 inline unsigned long StatusCode::getCode() const {
73  return d_code;
74 }
75 
76 inline void StatusCode::setCode(unsigned long value) {
77  d_code = value;
78 }
79 
80 inline StatusCode::operator unsigned long() const {
81  return d_code;
82 }
83 */
84 inline StatusCode& StatusCode::operator=(unsigned long value) {
85  d_code = value;
86  return *this;
87 }
88 /*
89 inline bool operator< ( const StatusCode& a, const StatusCode& b ) {
90  return a.d_code < b.d_code;
91 }
92 
93 inline bool operator> ( const StatusCode& a, const StatusCode& b ) {
94  return a.d_code > b.d_code;
95 }
96 */
97 #endif // STATUSCODES_H
98 
99 
100 
bool isFailure() const
Definition: StatusCode.h:68
unsigned long d_code
The status code.
Definition: StatusCode.h:58
StatusCode(unsigned long code=SUCCESS)
Constructor.
Definition: StatusCode.h:61
StatusCode & operator=(unsigned long value)
Assignment operator.
Definition: StatusCode.h:84
bool isSuccess() const
Definition: StatusCode.h:64