Hashable.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Hashable.h
00006  *
00007  *  Hashable.h,v 4.6 2005/10/28 16:14:52 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_HASHABLE_H
00014 #define ACE_HASHABLE_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/ACE_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00025 
00026 /**
00027  * @class ACE_Hashable
00028  *
00029  * @brief ACE_Hashable
00030  */
00031 class ACE_Export ACE_Hashable
00032 {
00033 public:
00034 
00035   /// Destructor.
00036   virtual ~ACE_Hashable (void);
00037 
00038   /// Computes and returns hash value.  This "caches" the hash value to
00039   /// improve performance.
00040   virtual unsigned long hash (void) const;
00041 
00042 protected:
00043   /// Protected constructor.
00044   ACE_Hashable (void);
00045 
00046   /// This is the method that actually performs the non-cached hash
00047   /// computation.
00048   virtual unsigned long hash_i (void) const = 0;
00049 
00050 protected:
00051 
00052   /// Pre-computed hash-value.
00053   mutable unsigned long hash_value_;
00054 
00055 };
00056 
00057 ACE_END_VERSIONED_NAMESPACE_DECL
00058 
00059 #if defined (__ACE_INLINE__)
00060 #include "ace/Hashable.inl"
00061 #endif /* __ACE_INLINE __ */
00062 
00063 #include /**/ "ace/post.h"
00064 
00065 #endif /*ACE_HASHABLE_H*/

Generated on Thu Nov 9 09:41:52 2006 for ACE by doxygen 1.3.6