add get_key() method for Python hashing

This commit is contained in:
David Rose 2007-04-24 14:56:23 +00:00
parent 936e6dcbbc
commit 490d24ef41
2 changed files with 14 additions and 0 deletions

View File

@ -699,6 +699,18 @@ operator >>= (int shift) {
_word >>= shift;
}
////////////////////////////////////////////////////////////////////
// Function: BitMask::get_key
// Access: Published
// Description: Returns a mostly unique integer key per unique
// bitmask, suitable for using in a hash table.
////////////////////////////////////////////////////////////////////
template<class WType, int nbits>
INLINE int BitMask<WType, nbits>::
get_key() const {
return (int)_word;
}
////////////////////////////////////////////////////////////////////
// Function: BitMask::generate_hash
// Access: Public

View File

@ -114,6 +114,8 @@ PUBLISHED:
INLINE void operator <<= (int shift);
INLINE void operator >>= (int shift);
INLINE int get_key() const;
public:
INLINE void generate_hash(ChecksumHashGenerator &hashgen) const;