diff options
author | Neo2003 <none@none> | 2008-10-04 06:17:19 -0500 |
---|---|---|
committer | Neo2003 <none@none> | 2008-10-04 06:17:19 -0500 |
commit | 5651828bf74edb760d67700942fc65d51c816e0a (patch) | |
tree | 1631f319bbc293794109f990beaccfd5b6cee8fe /dep/ACE_wrappers/ace/Hashable.cpp | |
parent | ca7a4bf1a78a1ddc6eb21238cc2a1633194a11cc (diff) |
[svn] * Added ACE for Linux and Windows (Thanks Derex for Linux part and partial Windows part)
* Updated to 6721 and 676
* Fixed TrinityScript logo
* Version updated to 0.2.6721.676
--HG--
branch : trunk
rename : 6700-670 => 6721-676
Diffstat (limited to 'dep/ACE_wrappers/ace/Hashable.cpp')
-rw-r--r-- | dep/ACE_wrappers/ace/Hashable.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Hashable.cpp b/dep/ACE_wrappers/ace/Hashable.cpp new file mode 100644 index 00000000000..94c25faf1c8 --- /dev/null +++ b/dep/ACE_wrappers/ace/Hashable.cpp @@ -0,0 +1,36 @@ +//$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $ + +#include "ace/Hashable.h" + +#if !defined (__ACE_INLINE__) +#include "ace/Hashable.inl" +#endif /* __ACE_INLINE __ */ + + +ACE_RCSID (ace, + Hashable, + "$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $") + + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_Hashable::~ACE_Hashable (void) +{ +} + +unsigned long +ACE_Hashable::hash (void) const +{ + // In doing the check below, we take chance of paying a performance + // price when the hash value is zero. But, that will (hopefully) + // happen far less often than a non-zero value, so this caching + // strategy should pay off, esp. if hash computation is expensive + // relative to the simple comparison. + + if (this->hash_value_ == 0) + this->hash_value_ = this->hash_i (); + + return this->hash_value_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL |