00001 #ifndef __COUNTER_H 00002 #define __COUNTER_H 00003 00004 //#include <sys/types.h> 00005 #include <iostream> 00006 #include "BasicObject.h" 00007 00008 //using namespace std; 00009 00010 class Counter : public BasicObject 00011 { 00012 public: 00013 Counter(); 00014 Counter(int maxNumber); 00015 Counter(int minNumber, int maxNumber); 00016 Counter(int minNumber, int maxNumber, int startValue); 00017 Counter(const Counter&); 00018 00019 int getCount(); 00020 int increment(); 00021 int decrement(); 00022 void setTo(int value); 00023 void setMin(int min); 00024 void setMax(int max); 00025 void toStream(std::ostream& out); 00026 00027 private: 00028 int m_count; 00029 int m_minValue; 00030 int m_maxValue; 00031 }; // class Counter 00032 00033 #endif