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