#include <Hashable.h>
Inheritance diagram for ACE_Hashable:

Public Methods | |
| virtual | ~ACE_Hashable (void) |
| Destructor. More... | |
| virtual unsigned long | hash (void) const |
| Computes and returns hash value. This "caches" the hash value to improve performance. More... | |
Protected Methods | |
| ACE_Hashable (void) | |
| Protected constructor. More... | |
| virtual unsigned long | hash_i (void) const=0 |
| This is the method that actually performs the non-cached hash computation. More... | |
Protected Attributes | |
| unsigned long | hash_value_ |
| Pre-computed hash-value. More... | |
Definition at line 30 of file Hashable.h.
|
|
Destructor.
Definition at line 13 of file Hashable.inl.
00014 {
00015 }
|
|
|
Protected constructor.
Definition at line 7 of file Hashable.inl.
00008 : hash_value_ (0) 00009 { 00010 } |
|
|
Computes and returns hash value. This "caches" the hash value to improve performance.
Definition at line 18 of file Hashable.inl. References hash_i, and hash_value_.
00019 {
00020 // In doing the check below, we take chance of paying a performance
00021 // price when the hash value is zero. But, that will (hopefully)
00022 // happen far less often than a non-zero value, so this caching
00023 // strategy should pay off, esp. if hash computation is expensive
00024 // relative to the simple comparison.
00025
00026 if (this->hash_value_ == 0)
00027 ((ACE_Hashable *) this)->hash_value_ = this->hash_i ();
00028
00029 return this->hash_value_;
00030 }
|
|
|
This is the method that actually performs the non-cached hash computation.
Implemented in ACE_Refcounted_Hash_Recyclable. Referenced by hash. |
|
|
Pre-computed hash-value.
Definition at line 52 of file Hashable.h. Referenced by hash. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002