All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
progress32.h
Go to the documentation of this file.
1 /* progress32.h
2  */
3 #ifndef PROGRESS_PROGRESS32_H
4 #define PROGRESS_PROGRESS32_H
5 
6 #include <cassert>
7 namespace osl
8 {
9  namespace progress
10  {
14  class Progress32
15  {
17  public:
18  explicit Progress32(int value) : progress32(value)
19  {
20  assert(isValid());
21  }
22  int value() const { return progress32; }
23  bool isValid() const {
24  return (progress32 >= 0) && (progress32 < 32);
25  }
26  };
27  inline bool operator==(Progress32 l, Progress32 r)
28  {
29  return l.value() == r.value();
30  }
31  inline bool operator!=(Progress32 l, Progress32 r)
32  {
33  return ! (l == r);
34  }
35  inline bool operator<(Progress32 l, Progress32 r)
36  {
37  return l.value() < r.value();
38  }
39  } // namespace progress
40  using progress::Progress32;
41 } // namespace osl
42 
43 #endif /* PROGRESS_PROGRESS32_H */
44 // ;;; Local Variables:
45 // ;;; mode:c++
46 // ;;; c-basic-offset:2
47 // ;;; End: