3 //=============================================================================
9 //=============================================================================
11 #ifndef ACE_HASHABLE_H
12 #define ACE_HASHABLE_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 class ACE_Export ACE_Hashable
33 virtual ~ACE_Hashable () = default;
35 /// Computes and returns hash value. This "caches" the hash value to
36 /// improve performance.
37 virtual unsigned long hash () const;
40 /// Protected constructor.
41 ACE_Hashable () = default;
43 /// This is the method that actually performs the non-cached hash
45 virtual unsigned long hash_i () const = 0;
48 /// Pre-computed hash-value.
49 mutable unsigned long hash_value_
{};
52 ACE_END_VERSIONED_NAMESPACE_DECL
54 #include /**/ "ace/post.h"
56 #endif /*ACE_HASHABLE_H*/