outcome.h
Go to the documentation of this file.00001 #ifndef OUTCOME_CLASS
00002 #define OUTCOME_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "definitions.h"
00019
00020 namespace basis {
00021
00023
00030 class outcome
00031 {
00032 public:
00033 outcome(int value = 0) : c_outcome_value(value) {}
00035
00041 ~outcome() { c_outcome_value = 0; }
00042
00043 bool equal_to(const outcome &to_compare) const
00044 { return c_outcome_value == to_compare.c_outcome_value; }
00046
00049 bool operator == (int to_compare) const
00050 { return c_outcome_value == to_compare; }
00052
00053 int value() const { return c_outcome_value; }
00054
00055
00056 int packed_size() const { return 4; }
00058
00061 private:
00062 int c_outcome_value;
00063 };
00064
00066
00068 #define PROMOTE_OUTCOME(outc) \
00069 if (outc != common::OKAY) return outc
00070
00072
00074
00080 #define DEFINE_OUTCOME(NAME, CURRENT_VALUE, INFO_STRING) \
00081 NAME = CURRENT_VALUE
00082
00084
00090 #define DEFINE_API_OUTCOME(NAME, CURRENT_VALUE, INFO_STRING) \
00091 NAME = CURRENT_VALUE
00092
00094
00095 }
00096
00097 #endif
00098