File: Poco.AbstractCache.html

package info (click to toggle)
poco-doc 1.3.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,096 kB
  • sloc: makefile: 9
file content (211 lines) | stat: -rw-r--r-- 16,438 bytes parent folder | download | duplicates (3)
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::AbstractCache</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="template">template &lt; class TKey, class TValue, class TStrategy &gt;</h1>
<h1 class="symbol">class AbstractCache</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Cache<br />
<b>Header:</b> Poco/AbstractCache.h</p>
<h2>Description</h2>
<div class="description">
<p>An <a href="Poco.AbstractCache.html" title="class Poco::AbstractCache">AbstractCache</a> is the interface of all caches.  </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.AbstractCache.html#3202" title="Poco::AbstractCache::add()">add</a>, <a href="Poco.AbstractCache.html#3214" title="Poco::AbstractCache::clear()">clear</a>, <a href="Poco.AbstractCache.html#3222" title="Poco::AbstractCache::doAdd()">doAdd</a>, <a href="Poco.AbstractCache.html#3234" title="Poco::AbstractCache::doClear()">doClear</a>, <a href="Poco.AbstractCache.html#3232" title="Poco::AbstractCache::doGet()">doGet</a>, <a href="Poco.AbstractCache.html#3230" title="Poco::AbstractCache::doHas()">doHas</a>, <a href="Poco.AbstractCache.html#3228" title="Poco::AbstractCache::doRemove()">doRemove</a>, <a href="Poco.AbstractCache.html#3235" title="Poco::AbstractCache::doReplace()">doReplace</a>, <a href="Poco.AbstractCache.html#3216" title="Poco::AbstractCache::forceReplace()">forceReplace</a>, <a href="Poco.AbstractCache.html#3212" title="Poco::AbstractCache::get()">get</a>, <a href="Poco.AbstractCache.html#3217" title="Poco::AbstractCache::getAllKeys()">getAllKeys</a>, <a href="Poco.AbstractCache.html#3210" title="Poco::AbstractCache::has()">has</a>, <a href="Poco.AbstractCache.html#3220" title="Poco::AbstractCache::initialize()">initialize</a>, <a href="Poco.AbstractCache.html#3208" title="Poco::AbstractCache::remove()">remove</a>, <a href="Poco.AbstractCache.html#3215" title="Poco::AbstractCache::size()">size</a>, <a href="Poco.AbstractCache.html#3221" title="Poco::AbstractCache::uninitialize()">uninitialize</a></p>
<h2>Types</h2>
<h3><a name="3196">ConstIterator</a></h3>
<p class="decl">typedef typename DataHolder::const_iterator <a href="Poco.AbstractCache.html#3196" title="Poco::AbstractCache::ConstIterator">ConstIterator</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3194">DataHolder</a></h3>
<p class="decl">typedef std::map &lt; TKey, <a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> &lt; TValue &gt; &gt; <a href="Poco.AbstractCache.html#3194" title="Poco::AbstractCache::DataHolder">DataHolder</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3195">Iterator</a></h3>
<p class="decl">typedef typename DataHolder::iterator <a href="Poco.AbstractCache.html#3195" title="Poco::AbstractCache::Iterator">Iterator</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3197">KeySet</a></h3>
<p class="decl">typedef std::set &lt; TKey &gt; <a href="Poco.AbstractCache.html#3197" title="Poco::AbstractCache::KeySet">KeySet</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="3198">AbstractCache</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.AbstractCache.html" title="class Poco::AbstractCache">AbstractCache</a>();</p>
<div class="description">
<p></p>
</div>
<h3><a name="3199">AbstractCache</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.AbstractCache.html" title="class Poco::AbstractCache">AbstractCache</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TStrategy &amp; strat<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Destructor</h2>
<h3><a name="3201">~AbstractCache</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.AbstractCache.html" title="class Poco::AbstractCache">AbstractCache</a>();</p>
<div class="description">
<p></p>
</div>
<h2>Member Functions</h2>
<h3><a name="3202">add</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void add(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;const TValue &amp; val<br />);</p>
<div class="description">
<p>Adds the key value pair to the cache. If for the key already an entry exists, it will be overwritten. </p>
</div>
<h3><a name="3205">add</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void add(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> &lt; TValue &gt; val<br />);</p>
<div class="description">
<p>Adds the key value pair to the cache. Note that adding a NULL <a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> will fail! If for the key already an entry exists, it will be overwritten. </p>
</div>
<h3><a name="3214">clear</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void clear();</p>
<div class="description">
<p>Removes all elements from the cache. </p>
</div>
<h3><a name="3216">forceReplace</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void forceReplace();</p>
<div class="description">
<p>Forces cache replacement. Note that <a href="Poco.html" title="namespace Poco">Poco</a>'s cache strategy use for efficiency reason no background thread which periodically triggers cache replacement. Cache Replacement is only started when the cache is modified from outside, i.e. add is called, or when a user tries to access an cache element via get. In some cases, i.e. expire based caching where for a long time no access to the cache happens, it might be desirable to be able to trigger cache replacement manually. </p>
</div>
<h3><a name="3212">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> &lt; TValue &gt; get(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key<br />);</p>
<div class="description">
<p>Returns a <a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> of the value. The SharedPointer will remain valid even when cache replacement removes the element. If for the key no value exists, an empty <a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> is returned. </p>
</div>
<h3><a name="3217">getAllKeys</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::set &lt; TKey &gt; getAllKeys();</p>
<div class="description">
<p>Returns a copy of all keys stored in the cache </p>
</div>
<h3><a name="3210">has</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool has(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key<br />) const;</p>
<div class="description">
<p>Returns true if the cache contains a value for the key. </p>
</div>
<h3><a name="3208">remove</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void remove(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key<br />);</p>
<div class="description">
<p>Removes an entry from the cache. If the entry is not found, the remove is ignored. </p>
</div>
<h3><a name="3215">size</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t size();</p>
<div class="description">
<p>Returns the number of cached elements </p>
</div>
<h3><a name="3222">doAdd</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void doAdd(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;const TValue &amp; val<br />);</p>
<div class="description">
<p>Adds the key value pair to the cache. If for the key already an entry exists, it will be overwritten. </p>
</div>
<h3><a name="3225">doAdd</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void doAdd(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> &lt; TValue &gt; &amp; val<br />);</p>
<div class="description">
<p>Adds the key value pair to the cache. If for the key already an entry exists, it will be overwritten. </p>
</div>
<h3><a name="3234">doClear</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void doClear();</p>
<div class="description">
<p></p>
</div>
<h3><a name="3232">doGet</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> &lt; TValue &gt; doGet(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key<br />);</p>
<div class="description">
<p>Returns a <a href="Poco.SharedPtr.html" title="class Poco::SharedPtr">SharedPtr</a> of the cache entry, returns 0 if for the key no value was found </p>
</div>
<h3><a name="3230">doHas</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool doHas(<br />&nbsp;&nbsp;&nbsp;&nbsp;const TKey &amp; key<br />) const;</p>
<div class="description">
<p>Returns true if the cache contains a value for the key </p>
</div>
<h3><a name="3228">doRemove</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void doRemove(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.AbstractCache.html#3195" title="Poco::AbstractCache::Iterator">Iterator</a> it<br />);</p>
<div class="description">
<p>Removes an entry from the cache. If the entry is not found the remove is ignored. </p>
</div>
<h3><a name="3235">doReplace</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void doReplace();</p>
<div class="description">
<p></p>
</div>
<h3><a name="3220">initialize</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void initialize();</p>
<div class="description">
<p>Sets up event registration. </p>
</div>
<h3><a name="3221">uninitialize</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void uninitialize();</p>
<div class="description">
<p>Reverts event registration. </p>
</div>
<h2>Variables</h2>
<h3><a name="3190">Add</a></h3>
<p class="decl"><a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; const <a href="Poco.KeyValueArgs.html" title="class Poco::KeyValueArgs">KeyValueArgs</a> &lt; TKey, TValue &gt; &gt; <a href="Poco.AbstractCache.html#3190" title="Poco::AbstractCache::Add">Add</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3193">Clear</a></h3>
<p class="decl"><a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; const <a href="Poco.EventArgs.html" title="class Poco::EventArgs">EventArgs</a> &gt; <a href="Poco.AbstractCache.html#3193" title="Poco::AbstractCache::Clear">Clear</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3192">Get</a></h3>
<p class="decl"><a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; const TKey &gt; <a href="Poco.AbstractCache.html#3192" title="Poco::AbstractCache::Get">Get</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3191">Remove</a></h3>
<p class="decl"><a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; const TKey &gt; <a href="Poco.AbstractCache.html#3191" title="Poco::AbstractCache::Remove">Remove</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3218">IsValid</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">mutable <a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; <a href="Poco.ValidArgs.html" title="class Poco::ValidArgs">ValidArgs</a> &lt; TKey &gt; &gt; <a href="Poco.AbstractCache.html#3218" title="Poco::AbstractCache::IsValid">IsValid</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3219">Replace</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">mutable <a href="Poco.FIFOEvent.html" title="class Poco::FIFOEvent">FIFOEvent</a> &lt; <a href="Poco.AbstractCache.html#3197" title="Poco::AbstractCache::KeySet">KeySet</a> &gt; <a href="Poco.AbstractCache.html#3219" title="Poco::AbstractCache::Replace">Replace</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3237">_data</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">mutable <a href="Poco.AbstractCache.html#3194" title="Poco::AbstractCache::DataHolder">DataHolder</a> _data;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3238">_mutex</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">mutable <a href="Poco.FastMutex.html" title="class Poco::FastMutex">FastMutex</a> _mutex;</p>
<div class="description">
<p></p>
</div>
<h3><a name="3236">_strategy</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">TStrategy _strategy;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>