diff options
author | kirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-03 23:35:58 +0000 |
---|---|---|
committer | kirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-03 23:35:58 +0000 |
commit | 4531c0210dd75bccba0fc1ffa6264e1e7c5ef831 (patch) | |
tree | aec34216751cc59414aa66e2b7a42b6f181cf36d /ace/Caching_Utility_T.h | |
parent | 5f8448bbe1989caf26f0e195c773d70b87577b8d (diff) | |
download | ATCD-4531c0210dd75bccba0fc1ffa6264e1e7c5ef831.tar.gz |
Tue Aug 03 18:30:47 1999 Kirthika Parameswaran
<kirthika@cs.wustl.edu>
Diffstat (limited to 'ace/Caching_Utility_T.h')
-rw-r--r-- | ace/Caching_Utility_T.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/ace/Caching_Utility_T.h b/ace/Caching_Utility_T.h index cb036782343..56798bf6903 100644 --- a/ace/Caching_Utility_T.h +++ b/ace/Caching_Utility_T.h @@ -129,6 +129,64 @@ protected: //////////////////////////////////////////////////////////////////////////////////////// template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBUTES> +class ACE_Refcounted_Recyclable_Handler_Caching_Utility +{ + // = TITLE + // Defines a helper class for the Caching Strategies. + // + // = DESCRIPTION + // This class defines the methods commonly used by the different + // caching strategies. For instance: clear_cache () method which + // decides and purges the entry from the container. Note: This + // class helps in the caching_strategies using a container + // containing entries of <Refcounted_KEY, + // Recyclable_Connection_Handler> kind. The attributes helps in + // deciding the entries to be purged. The Cleanup_Strategy is the + // callback class to which the entries to be cleaned up will be + // delegated. + +public: + + typedef ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; + typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE; + + ACE_Refcounted_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> *cleanup_strategy = 0, + int delete_cleanup_strategy = 0); + + // Constructor. + + ~ACE_Refcounted_Recyclable_Handler_Caching_Utility (void); + // Destructor. + + int clear_cache (CONTAINER &container, + double purge_percent); + // Purge entries from the <container>. The Cleanup_Strategy will do + // the actual job of cleanup once the entries to be cleaned up are + // decided. + +protected: + + void minimum (CONTAINER &container, + KEY *&key_to_remove, + VALUE *&value_to_remove); + // Find the entry with minimum caching attributes. + + CLEANUP_STRATEGY_BASE *cleanup_strategy_; + // This is the default Cleanup Strategy for this utility. + + int delete_cleanup_strategy_; + // Whether the cleanup_strategy should be destroyed or not. + + size_t marked_as_closed_entries_; + // This figure denotes the number of entries are there in the + // container which have been marked as closed already but might + // not have been unbound from the container. + +}; + +//////////////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBUTES> class ACE_Handler_Caching_Utility { // = TITLE |