Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Hashable.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Hashable.h
00006  *
00007  *  $Id: Hashable.h,v 1.1.1.1 2003/02/21 18:36:32 chad 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 
00025 /**
00026  * @class ACE_Hashable
00027  *
00028  * @brief ACE_Hashable
00029  */
00030 class ACE_Export ACE_Hashable
00031 {
00032 public:
00033 
00034   /// Destructor.
00035   virtual ~ACE_Hashable (void);
00036 
00037   /// Computes and returns hash value.  This "caches" the hash value to
00038   /// improve performance.
00039   virtual unsigned long hash (void) const;
00040 
00041 protected:
00042   /// Protected constructor.
00043   ACE_Hashable (void);
00044 
00045   /// This is the method that actually performs the non-cached hash
00046   /// computation.
00047   virtual unsigned long hash_i (void) const = 0;
00048 
00049 protected:
00050 
00051   /// Pre-computed hash-value.
00052   unsigned long hash_value_;
00053 
00054 };
00055 
00056 
00057 #if defined (__ACE_INLINE__)
00058 #include "ace/Hashable.inl"
00059 #endif /* __ACE_INLINE __ */
00060 
00061 #include "ace/post.h"
00062 
00063 #endif /*ACE_HASHABLE_H*/

Generated on Mon Jun 16 11:19:51 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002