00001 // -*- C++ -*- 00002 00003 // ================================================================ 00004 /** 00005 * @file LRU_Connection_Purging_Strategy.h 00006 * 00007 * $Id: LRU_Connection_Purging_Strategy.h 84196 2009-01-19 19:40:14Z johnnyw $ 00008 * 00009 * @author Chad Elliott (elliott_c@ociweb.com) 00010 */ 00011 // ================================================================ 00012 00013 #ifndef TAO_LRU_PURGING_STRATEGY_H 00014 #define TAO_LRU_PURGING_STRATEGY_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/Connection_Purging_Strategy.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 // **************************************************************** 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 /** 00029 * @class TAO_LRU_Connection_Purging_Strategy 00030 * 00031 * @brief The Least Recently Used connection purging strategy 00032 * 00033 * This class maintains it's own count which is applied to the 00034 * item passed in. This way, the least recently used transport 00035 * has the smallest ordering number and will therefore be purged 00036 * first. 00037 */ 00038 class TAO_Export TAO_LRU_Connection_Purging_Strategy 00039 : public TAO_Connection_Purging_Strategy 00040 { 00041 public: 00042 /// The constructor 00043 TAO_LRU_Connection_Purging_Strategy (int cache_maximum); 00044 00045 /// The destructor 00046 virtual ~TAO_LRU_Connection_Purging_Strategy (void); 00047 00048 /// Called when accessing an item from the cache 00049 virtual void update_item (TAO_Transport* transport); 00050 00051 private: 00052 /// The ordering information for each transport in the cache 00053 unsigned long order_; 00054 }; 00055 00056 TAO_END_VERSIONED_NAMESPACE_DECL 00057 00058 #include /**/ "ace/post.h" 00059 00060 #endif /* TAO_LRU_PURGING_STRATEGY_H */