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