00001 #ifndef EVENT_LOOP_STATUS_CODE_HH
00002 #define EVENT_LOOP_STATUS_CODE_HH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00017
00018
00019
00020 #include <EventLoop/Global.h>
00021
00022 namespace EL
00023 {
00024 class StatusCode
00025 {
00026 unsigned long m_code;
00027 public:
00028 enum {
00029 FAILURE = 0,
00030 SUCCESS = 1
00031
00032 };
00033
00035 StatusCode(): m_code(SUCCESS) {}
00036 StatusCode( unsigned long code) : m_code(code){};
00037 bool operator == (unsigned long code) const {return m_code == code;};
00038 bool operator != (unsigned long code) const {return m_code != code;};
00039 };
00040 }
00041
00042 namespace asg
00043 {
00046 template<typename T> struct CheckHelper;
00047
00048 template<> struct CheckHelper<EL::StatusCode>
00049 {
00051 static inline bool isSuccess (const EL::StatusCode& sc) {
00052 return sc == EL::StatusCode::SUCCESS; }
00053
00055 static inline EL::StatusCode successCode () {
00056 return EL::StatusCode::SUCCESS;}
00057
00059 static inline EL::StatusCode failureCode () {
00060 return EL::StatusCode::FAILURE;}
00061 };
00062 }
00063
00064 #endif