1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
.TH ACE_LFU_Caching_Strategy 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_LFU_Caching_Strategy \- Defines a Least Frequently Used strategy for which will decide on the item to be removed from the cache.
.SH SYNOPSIS
.br
.PP
\fC#include <Caching_Strategies_T.h>\fR
.PP
.SS Public Types
.in +1c
.ti -1c
.RI "typedef ATTRIBUTES \fBCACHING_ATTRIBUTES\fR"
.br
.in -1c
.SS Public Methods
.in +1c
.ti -1c
.RI "\fBACE_LFU_Caching_Strategy\fR (void)"
.br
.ti -1c
.RI "ATTRIBUTES \fBattributes\fR (void)"
.br
.RI "\fIAccess the attributes.\fR"
.ti -1c
.RI "double \fBpurge_percent\fR (void)"
.br
.ti -1c
.RI "void \fBpurge_percent\fR (double percentage)"
.br
.ti -1c
.RI "int \fBnotify_bind\fR (int result, const ATTRIBUTES &attr)"
.br
.RI "\fIThis method acts as a notification about the CONTAINERs bind method call.\fR"
.ti -1c
.RI "int \fBnotify_find\fR (int result, ATTRIBUTES &attr)"
.br
.RI "\fILookup notification.\fR"
.ti -1c
.RI "int \fBnotify_unbind\fR (int result, const ATTRIBUTES &attr)"
.br
.RI "\fIThis method acts as a notification about the CONTAINERs unbind method call.\fR"
.ti -1c
.RI "int \fBnotify_trybind\fR (int result, ATTRIBUTES &attr)"
.br
.RI "\fIThis method acts as a notification about the CONTAINERs trybind method call.\fR"
.ti -1c
.RI "int \fBnotify_rebind\fR (int result, const ATTRIBUTES &attr)"
.br
.RI "\fIThis method acts as a notification about the CONTAINERs rebind method call.\fR"
.ti -1c
.RI "CACHING_UTILITY& \fBcaching_utility\fR (void)"
.br
.RI "\fIPurge the cache.\fR"
.ti -1c
.RI "void \fBdump\fR (void) const"
.br
.RI "\fIDumps the state of the object.\fR"
.in -1c
.SS Private Attributes
.in +1c
.ti -1c
.RI "double \fBpurge_percent_\fR"
.br
.RI "\fIThe level about which the purging will happen automagically.\fR"
.ti -1c
.RI "CACHING_UTILITY \fBcaching_utility_\fR"
.br
.RI "\fIThis is the helper class which will decide and expunge entries from the cache.\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP
.SS template<class ATTRIBUTES, class CACHING_UTILITY> template class ACE_LFU_Caching_Strategy
Defines a Least Frequently Used strategy for which will decide on the item to be removed from the cache.
.PP
.PP
A attribute is tagged to each item which increments whenever the item is bound or looked up in the cache. Thus it denotes the frequency of use. According to the value of the attribute the item is removed from the CONTAINER i.e cache. Explanation of the template parameter list: CONTAINER is any map with entries of type <KEY, VALUE>. The ATTRIBUTES are the deciding factor for purging of entries and should logically be included with the VALUE. Some ways of doing this are: As being a member of the VALUE or VALUE being \fBACE_Pair\fR<x, ATTRIBUTES>. The CACHING_UTILITY is the class which can be plugged in and which decides the entries to purge.
.PP
.SH MEMBER TYPEDEF DOCUMENTATION
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> typedef ATTRIBUTES ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::CACHING_ATTRIBUTES
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> (void)
.PP
The <container> is the map in which the entries reside. The timer attribute is initialed to zero in this constructor. And the <purge_percent> field denotes the percentage of the entries in the cache which can be purged automagically and by default is set to 10%.
.SH MEMBER FUNCTION DOCUMENTATION
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> ATTRIBUTES ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes (void)
.PP
Access the attributes.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> CACHING_UTILITY & ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility (void)
.PP
Purge the cache.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> void ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump (void) const
.PP
Dumps the state of the object.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> int ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result, const ATTRIBUTES & attr)
.PP
This method acts as a notification about the CONTAINERs bind method call.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> int ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result, ATTRIBUTES & attr)
.PP
Lookup notification.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> int ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result, const ATTRIBUTES & attr)
.PP
This method acts as a notification about the CONTAINERs rebind method call.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> int ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result, ATTRIBUTES & attr)
.PP
This method acts as a notification about the CONTAINERs trybind method call.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> int ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result, const ATTRIBUTES & attr)
.PP
This method acts as a notification about the CONTAINERs unbind method call.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> void ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> double ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (void)
.PP
.SH MEMBER DATA DOCUMENTATION
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> CACHING_UTILITY ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility_\fC [private]\fR
.PP
This is the helper class which will decide and expunge entries from the cache.
.PP
.SS template<classATTRIBUTES, classCACHING_UTILITY> double ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent_\fC [private]\fR
.PP
The level about which the purging will happen automagically.
.PP
.SH AUTHOR
.PP
Generated automatically by Doxygen for ACE from the source code.
|