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

IntegerCounter.h

Go to the documentation of this file.
00001 #ifndef IntegerCounter_H 00002 #define IntegerCounter_H 00003 00004 #include "PtMutex.h" 00005 00006 BOREALIS_NAMESPACE_BEGIN; 00007 00012 class IntegerCounter 00013 { 00014 public: 00015 IntegerCounter() 00016 throw (std::exception); 00017 00018 virtual ~IntegerCounter(); 00019 00020 // If the current value of the int is < maxValue, this will increment the int 00021 // by one and return true. 00022 // If incrementing the int would make its value exceed 'maxValue', then this 00023 // will return false and will not modify the int. 00024 bool incrementWithTest(int maxValue) 00025 throw (std::exception); 00026 00027 // Decrements the int. If decrementing the value would make the int negative, then 00028 // this is a no-op, and throws an exception. 00029 void decrement() 00030 throw (std::exception); 00031 00032 int getValue() 00033 throw (std::exception); 00034 00035 private: 00036 IntegerCounter(const IntegerCounter & rhs); 00037 IntegerCounter & operator= (const IntegerCounter & rhs); 00038 00039 PtMutex * _pMtx; 00040 int _intValue; 00041 }; 00042 00043 BOREALIS_NAMESPACE_END; 00044 00045 #endif

Generated on Fri Nov 12 15:15:21 2004 for Borealis by doxygen 1.3.8