3 //////////////////////////////////////////////////////////////////////////////////
5 #include "ace/OS_Memory.h"
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE
10 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation,
11 bool delete_implementation)
12 : implementation_ (implementation),
13 delete_implementation_ (delete_implementation)
15 if (this->implementation_ == 0)
17 ACE_NEW (this->implementation_,
19 this->delete_implementation_ = true;
23 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE
24 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::~ACE_Caching_Strategy_Adapter ()
26 if (this->delete_implementation_)
28 delete this->implementation_;
29 this->delete_implementation_ = false;
30 this->implementation_ = 0;
34 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE ATTRIBUTES
35 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::attributes ()
37 return this->implementation_->attributes ();
40 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE double
41 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::purge_percent ()
43 return this->implementation_->purge_percent ();
46 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE void
47 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::purge_percent (double percentage)
49 this->implementation_->purge_percent (percentage);
52 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
53 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_bind (int result,
54 const ATTRIBUTES &attr)
56 return this->implementation_->notify_bind (result,
60 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
61 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_find (int result,
64 return this->implementation_->notify_find (result,
68 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
69 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_unbind (int result,
70 const ATTRIBUTES &attr)
72 return this->implementation_->notify_unbind (result,
76 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
77 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_trybind (int result,
80 return this->implementation_->notify_trybind (result,
84 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
85 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_rebind (int result,
86 const ATTRIBUTES &attr)
88 return this->implementation_->notify_rebind (result,
92 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE IMPLEMENTATION &
93 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::implementation ()
95 return *this->implementation_;
98 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE CACHING_UTILITY &
99 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::caching_utility ()
101 return this->implementation_->caching_utility ();
104 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE void
105 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::dump () const
107 #if defined (ACE_HAS_DUMP)
108 ACE_TRACE ("ACE_Caching_Strategy_Adapter::dump");
110 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
111 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
112 #endif /* ACE_HAS_DUMP */
115 //////////////////////////////////////////////////////////////////////////////////
117 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
118 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes ()
123 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
124 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent ()
126 return this->purge_percent_;
129 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
130 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
132 this->purge_percent_ = percentage;
135 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
136 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (
138 const ATTRIBUTES & /* attr */)
146 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
147 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (
160 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
161 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (
163 const ATTRIBUTES & /* attr */)
168 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
169 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (
171 ATTRIBUTES & /* attr */)
176 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
177 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (
179 const ATTRIBUTES & /* attr */)
187 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
188 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility ()
190 return this->caching_utility_;
193 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
194 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump () const
196 #if defined (ACE_HAS_DUMP)
197 ACE_TRACE ("ACE_LRU_Caching_Strategy::dump");
199 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
200 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("timer_ = %d "), this->timer_));
201 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
202 #endif /* ACE_HAS_DUMP */
205 //////////////////////////////////////////////////////////////////////////////////
207 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
208 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes ()
213 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
214 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent ()
216 return this->purge_percent_;
219 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
220 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
222 this->purge_percent_ = percentage;
225 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
226 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
227 const ATTRIBUTES & /* attr */)
233 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
234 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
243 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
244 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
245 ATTRIBUTES & /* attr */)
250 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
251 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
252 const ATTRIBUTES & /* attr */)
257 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
258 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
259 const ATTRIBUTES & /* attr */)
264 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
265 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility ()
267 return this->caching_utility_;
270 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
271 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump () const
273 #if defined (ACE_HAS_DUMP)
274 ACE_TRACE ("ACE_LFU_Caching_Strategy::dump");
276 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
277 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
278 #endif /* ACE_HAS_DUMP */
281 //////////////////////////////////////////////////////////////////////////////////////
283 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
284 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes ()
289 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
290 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent ()
292 return this->purge_percent_;
295 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
296 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
298 this->purge_percent_ = percentage;
301 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
302 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
303 const ATTRIBUTES &attr)
305 ACE_UNUSED_ARG (attr);
313 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
314 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
317 ACE_UNUSED_ARG (attr);
322 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
323 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
324 const ATTRIBUTES &attr)
326 ACE_UNUSED_ARG (attr);
331 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
332 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
335 ACE_UNUSED_ARG (attr);
340 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
341 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
342 const ATTRIBUTES &attr)
344 ACE_UNUSED_ARG (attr);
352 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
353 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility ()
355 return this->caching_utility_;
358 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
359 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump () const
361 #if defined (ACE_HAS_DUMP)
362 ACE_TRACE ("ACE_FIFO_Caching_Strategy::dump");
364 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
365 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("order_ = %d "), this->order_));
366 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
367 #endif /* ACE_HAS_DUMP */
370 //////////////////////////////////////////////////////////////////////////////////
372 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
373 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes ()
378 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
379 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent ()
384 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
385 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
387 ACE_UNUSED_ARG (percentage);
390 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
391 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
392 const ATTRIBUTES &attr)
394 ACE_UNUSED_ARG (attr);
399 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
400 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
403 ACE_UNUSED_ARG (attr);
408 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
409 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
410 const ATTRIBUTES &attr)
412 ACE_UNUSED_ARG (attr);
417 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
418 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
421 ACE_UNUSED_ARG (attr);
426 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
427 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
428 const ATTRIBUTES &attr)
430 ACE_UNUSED_ARG (attr);
435 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
436 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility ()
438 return this->caching_utility_;
441 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
442 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump () const
444 #if defined (ACE_HAS_DUMP)
445 ACE_TRACE ("ACE_Null_Caching_Strategy::dump");
447 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
448 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
449 #endif /* ACE_HAS_DUMP */
452 ACE_END_VERSIONED_NAMESPACE_DECL
454 //////////////////////////////////////////////////////////////////////////////////