summaryrefslogtreecommitdiff
path: root/ace/Caching_Utility_T.h
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-03 23:35:58 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-03 23:35:58 +0000
commitba59fcd9bd979d8407db25a1c294bcb0a24391c3 (patch)
treeaec34216751cc59414aa66e2b7a42b6f181cf36d /ace/Caching_Utility_T.h
parente5d89088f23f7bb1adf5a0ac9b94d3c0a5fe3286 (diff)
downloadATCD-ba59fcd9bd979d8407db25a1c294bcb0a24391c3.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.h58
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