diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
commit | 0e49389337be86641451a5c36c24bf742fe97523 (patch) | |
tree | 197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tao/LRU_Connection_Purging_Strategy.h | |
parent | 8008dd09ccf88d4edef237a184a698cac42f2952 (diff) | |
download | ATCD-0e49389337be86641451a5c36c24bf742fe97523.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tao/LRU_Connection_Purging_Strategy.h')
-rw-r--r-- | TAO/tao/LRU_Connection_Purging_Strategy.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/TAO/tao/LRU_Connection_Purging_Strategy.h b/TAO/tao/LRU_Connection_Purging_Strategy.h new file mode 100644 index 00000000000..8ea7319d723 --- /dev/null +++ b/TAO/tao/LRU_Connection_Purging_Strategy.h @@ -0,0 +1,61 @@ +// -*- C++ -*- + +// ================================================================ +/** + * @file LRU_Connection_Purging_Strategy.h + * + * $Id$ + * + * @author Chad Elliott (elliott_c@ociweb.com) + */ +// ================================================================ + +#ifndef TAO_LRU_PURGING_STRATEGY_H +#define TAO_LRU_PURGING_STRATEGY_H + +#include /**/ "ace/pre.h" + +#include "tao/Connection_Purging_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// **************************************************************** + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class TAO_LRU_Connection_Purging_Strategy + * + * @brief The Least Recently Used connection purging strategy + * + * This class maintains it's own count which is applied to the + * item passed in. This way, the least recently used transport + * has the smallest ordering number and will therefore be purged + * first. + */ + +class TAO_Export TAO_LRU_Connection_Purging_Strategy + : public TAO_Connection_Purging_Strategy +{ +public: + /// The constructor + TAO_LRU_Connection_Purging_Strategy (int cache_maximum); + + /// The destructor + virtual ~TAO_LRU_Connection_Purging_Strategy (void); + + /// Called when accessing an item from the cache + virtual void update_item (TAO_Transport* transport); + +private: + /// The ordering information for each transport in the cache + unsigned long order_; +}; + +TAO_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#endif /* TAO_LRU_PURGING_STRATEGY_H */ |