00001 00036 #ifndef ABA_SLACKSTAT_H 00037 #define ABA_SLACKSTAT_H 00038 #include <iostream> 00039 using namespace std; 00040 00041 00042 #include "abacus/abacusroot.h" 00043 00044 class ABA_GLOBAL; 00045 00046 #ifdef ABACUS_PARALLEL 00047 class ABA_MESSAGE; 00048 #endif 00049 00050 class ABA_SLACKSTAT : public ABA_ABACUSROOT { 00051 public: 00052 00064 enum STATUS {Basic, NonBasicZero, NonBasicNonZero, Unknown}; 00065 00071 ABA_SLACKSTAT(const ABA_GLOBAL *glob); 00072 00078 ABA_SLACKSTAT(const ABA_GLOBAL *glob, STATUS status); 00079 #ifdef ABACUS_PARALLEL 00080 00086 ABA_SLACKSTAT(const ABA_GLOBAL *glob, ABA_MESSAGE &msg); 00087 00092 void pack(ABA_MESSAGE &msg) const; 00093 #endif 00094 00105 friend ostream &operator<<(ostream& out, const ABA_SLACKSTAT &rhs); 00106 00109 STATUS status() const; 00110 00116 void status(STATUS stat); 00117 00123 void status(const ABA_SLACKSTAT *stat); 00124 00125 private: 00126 00129 const ABA_GLOBAL *glob_; 00130 00133 STATUS status_; 00134 }; 00135 00136 00137 inline ABA_SLACKSTAT::ABA_SLACKSTAT(const ABA_GLOBAL *glob) 00138 : 00139 glob_(glob), 00140 status_(Unknown) 00141 { } 00142 00143 inline ABA_SLACKSTAT::ABA_SLACKSTAT(const ABA_GLOBAL *glob, STATUS status) 00144 : 00145 glob_(glob), 00146 status_(status) 00147 { } 00148 00149 inline ABA_SLACKSTAT::STATUS ABA_SLACKSTAT::status() const 00150 { 00151 return status_; 00152 } 00153 00154 inline void ABA_SLACKSTAT::status(STATUS stat) 00155 { 00156 status_ = stat; 00157 } 00158 00159 inline void ABA_SLACKSTAT::status(const ABA_SLACKSTAT *stat) 00160 { 00161 status_ = stat->status_; 00162 } 00163 00164 00165 #endif // ABA_SLACKSTAT_H 00166