00001 /* progress16.h 00002 */ 00003 #ifndef PROGRESS_PROGRESS16_H 00004 #define PROGRESS_PROGRESS16_H 00005 00006 #include <cassert> 00007 namespace osl 00008 { 00009 namespace progress 00010 { 00014 class Progress16 00015 { 00016 int progress16; 00017 public: 00018 explicit Progress16(int value=0) : progress16(value) 00019 { 00020 assert(isValid()); 00021 } 00022 int value() const { return progress16; } 00023 bool isValid() const { 00024 return (progress16 >= 0) && (progress16 < 16); 00025 } 00026 }; 00027 inline bool operator==(Progress16 l, Progress16 r) 00028 { 00029 return l.value() == r.value(); 00030 } 00031 inline bool operator!=(Progress16 l, Progress16 r) 00032 { 00033 return ! (l == r); 00034 } 00035 inline bool operator<(Progress16 l, Progress16 r) 00036 { 00037 return l.value() < r.value(); 00038 } 00039 } // namespace progress 00040 using progress::Progress16; 00041 } // namespace osl 00042 00043 #endif /* PROGRESS_PROGRESS16_H */ 00044 // ;;; Local Variables: 00045 // ;;; mode:c++ 00046 // ;;; c-basic-offset:2 00047 // ;;; End: