00001 00038 #ifndef ABA_CSENSE_H 00039 #define ABA_CSENSE_H 00040 #include <iostream> 00041 using namespace std; 00042 00043 #include "abacus/abacusroot.h" 00044 00045 class ABA_GLOBAL; 00046 00047 #ifdef ABACUS_PARALLEL 00048 class ABA_MESSAGE; 00049 #endif 00050 class ABA_CSENSE : public ABA_ABACUSROOT { 00051 public: 00052 00057 enum SENSE {Less, Equal, Greater}; 00058 00063 ABA_CSENSE(ABA_GLOBAL *glob); 00064 00070 ABA_CSENSE(ABA_GLOBAL *glob, SENSE s); 00071 00081 ABA_CSENSE(ABA_GLOBAL *glob, char s); 00082 #ifdef ABACUS_PARALLEL 00083 00088 ABA_CSENSE(ABA_GLOBAL *glob, ABA_MESSAGE &msg); 00089 00094 void pack(ABA_MESSAGE &msg) const; 00095 #endif 00096 00105 friend ostream& operator<<(ostream &out, const ABA_CSENSE &rhs); 00106 00115 const ABA_CSENSE &operator=(SENSE rhs); 00116 00120 SENSE sense() const; 00121 00128 void sense(SENSE s); 00129 00135 void sense(char s); 00136 00137 private: 00138 ABA_GLOBAL *glob_; 00139 00142 SENSE sense_; 00143 }; 00144 00145 00146 inline const ABA_CSENSE &ABA_CSENSE::operator=(SENSE rhs) 00147 { 00148 sense_ = rhs; 00149 return *this; 00150 } 00151 00152 inline ABA_CSENSE::SENSE ABA_CSENSE::sense() const 00153 { 00154 return sense_; 00155 } 00156 00157 inline void ABA_CSENSE::sense(SENSE s) 00158 { 00159 sense_ = s; 00160 } 00161 00162 00163 #endif // ABA_CSENSE_H 00164