Преглед на файлове

let's try operator WType

rdb преди 13 години
родител
ревизия
0b4654d512
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 12 0
      panda/src/putil/bitMask.I
  2. 2 0
      panda/src/putil/bitMask.h

+ 12 - 0
panda/src/putil/bitMask.I

@@ -821,6 +821,18 @@ operator >>= (int shift) {
   _word >>= shift;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BitMask::operator WType
+//       Access: Published
+//  Description: Used to cast this BitMask back into the
+//               underlying integer type.
+////////////////////////////////////////////////////////////////////
+template<class WType, int nbits>
+INLINE BitMask<WType, nbits>::
+operator WType () const {
+  return _word;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: BitMask::get_key
 //       Access: Published

+ 2 - 0
panda/src/putil/bitMask.h

@@ -118,6 +118,8 @@ PUBLISHED:
   INLINE void operator <<= (int shift);
   INLINE void operator >>= (int shift);
 
+  INLINE operator WType () const;
+
   INLINE void flood_down_in_place();
   INLINE void flood_up_in_place();
   INLINE BitMask<WType, nbits> flood_bits_down() const;