Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

StatusCode.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GaudiKernel/GaudiKernel/StatusCode.h,v 1.1.1.1 2001/04/18 18:14:18 tlindner Exp $
00002 #ifndef KERNEL_STATUSCODES_H
00003 #define KERNEL_STATUSCODES_H
00004 
00005 
00013 class StatusCode {
00014 public:
00015   enum {
00016     FAILURE = 0,
00017     SUCCESS = 1
00018   };
00019 
00021   StatusCode( unsigned long code = SUCCESS );
00022 
00026   bool isSuccess() const;
00027 
00033   bool isFailure() const;
00034 
00036   unsigned long getCode() const;
00037 
00039   void setCode( unsigned long );
00040 
00042   operator unsigned long() const;
00043 
00045   StatusCode& operator=(unsigned long value);
00046 
00048   friend bool operator< ( const StatusCode& a, const StatusCode& b );
00049 
00051   friend bool operator> ( const StatusCode& a, const StatusCode& b );
00052 
00053 protected:
00055   unsigned long d_code;
00056 };
00057 
00058 inline StatusCode::StatusCode( unsigned long code ) : d_code(code) {
00059 }
00060 
00061 inline bool StatusCode::isSuccess() const {
00062   return (d_code == SUCCESS );
00063 }
00064 
00065 inline bool StatusCode::isFailure() const {
00066   return (d_code != SUCCESS );
00067 }
00068 
00069 inline unsigned long StatusCode::getCode() const {
00070   return d_code;
00071 }
00072 
00073 inline void StatusCode::setCode(unsigned long value) {
00074   d_code = value;
00075 }
00076 
00077 inline StatusCode::operator unsigned long() const  {
00078   return d_code;
00079 }
00080 
00081 inline StatusCode& StatusCode::operator=(unsigned long value)   {
00082   d_code = value;
00083   return *this;
00084 }
00085 
00086 inline bool operator< ( const StatusCode& a, const StatusCode& b ) {
00087   return a.d_code < b.d_code;
00088 }
00089 
00090 inline bool operator> ( const StatusCode& a, const StatusCode& b ) {
00091   return a.d_code > b.d_code;
00092 }
00093 
00094 #endif  // GAUDIKERNEL_STATUSCODES_H
00095 
00096 
00097 

Generated at Wed Nov 21 12:22:05 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000