All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pieceMask64.h
Go to the documentation of this file.
1 /* pieceMask64.h
2  */
3 #ifndef PIECEMASK64_H
4 #define PIECEMASK64_H
5 
6 #include "osl/misc/mask.h"
7 
8 namespace osl
9 {
10  namespace container
11  {
13  {
14  protected:
16  public:
17  static int numToIndex(int) { return 0; }
18  static int numToOffset(int num) { return num; }
20  explicit PieceMask64(misc::Mask64 const& m) : mask(m) {}
21  protected:
22  misc::Mask64& mutableMask(int) { return mask; }
23  public:
24  const misc::Mask64& getMask(int) const { return mask; }
25  void resetAll()
26  {
28  }
29  void setAll()
30  {
31  mask=misc::Mask64::makeDirect(0xffffffffffuLL);
32  }
34  {
35  mask ^= o.mask;
36  return *this;
37  }
39  {
40  mask &= o.mask;
41  return *this;
42  }
44  {
45  mask |= o.mask;
46  return *this;
47  }
49  {
50  mask -= o.mask;
51  return *this;
52  }
54  {
55  mask += o.mask;
56  return *this;
57  }
58  bool none() const { return mask.none(); }
59  bool hasMultipleBit() const
60  {
61  if (none())
62  return false;
63  return mask.hasMultipleBit();
64  }
69  int countBit2() const
70  {
71  if (none())
72  return 0;
73  return mask.countBit2();
74  }
75  int
76 #ifdef __GNUC__
77  __attribute__ ((pure))
78 #endif
79  countBit() const
80  {
81  return mask.countBit();
82  }
83  int takeOneBit()
84  {
85  assert(!none());
86  return mask.takeOneBit();
87  }
88  };
89 } // namespace container
90  using container::PieceMask64;
91 } // namespace osl
92 
93 
94 #endif /* PIECEMASK64_H */
95 // ;;; Local Variables:
96 // ;;; mode:c++
97 // ;;; c-basic-offset:2
98 // ;;; End: