Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Caching_Strategies_T.i

Go to the documentation of this file.
00001 /* -*-C++-*- */
00002 //$Id: Caching_Strategies_T.i,v 1.1.1.3 2001/12/04 14:32:59 chad Exp $
00003 
00004 //////////////////////////////////////////////////////////////////////////////////
00005 
00006 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE
00007 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation,
00008                                                                                                          int delete_implementation)
00009   : implementation_ (implementation),
00010     delete_implementation_ (delete_implementation)
00011 {
00012   if (this->implementation_ == 0)
00013     {
00014       ACE_NEW (this->implementation_,
00015                IMPLEMENTATION);
00016       this->delete_implementation_ = 1;
00017     }
00018 }
00019 
00020 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE
00021 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::~ACE_Caching_Strategy_Adapter (void)
00022 {
00023   if (this->delete_implementation_)
00024     {
00025       delete this->implementation_;
00026       this->delete_implementation_ = 0;
00027       this->implementation_ = 0;
00028     }
00029 }
00030 
00031 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE ATTRIBUTES
00032 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::attributes (void)
00033 {
00034   return this->implementation_->attributes ();
00035 }
00036 
00037 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE double
00038 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::purge_percent (void)
00039 {
00040   return this->implementation_->purge_percent ();
00041 }
00042 
00043 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE void
00044 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::purge_percent (double percentage)
00045 {
00046   this->implementation_->purge_percent (percentage);
00047 }
00048 
00049 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
00050 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_bind (int result,
00051                                                                                         const ATTRIBUTES &attr)
00052 {
00053   return this->implementation_->notify_bind (result,
00054                                              attr);
00055 }
00056 
00057 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
00058 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_find (int result,
00059                                                                                         ATTRIBUTES &attr)
00060 {
00061   return this->implementation_->notify_find (result,
00062                                              attr);
00063 }
00064 
00065 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
00066 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_unbind (int result,
00067                                                                                           const ATTRIBUTES &attr)
00068 {
00069   return this->implementation_->notify_unbind (result,
00070                                                attr);
00071 }
00072 
00073 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
00074 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_trybind (int result,
00075                                                                                            ATTRIBUTES &attr)
00076 {
00077   return this->implementation_->notify_trybind (result,
00078                                                 attr);
00079 }
00080 
00081 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE int
00082 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::notify_rebind (int result,
00083                                                                                           const ATTRIBUTES &attr)
00084 {
00085   return this->implementation_->notify_rebind (result,
00086                                                attr);
00087 }
00088 
00089 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE IMPLEMENTATION &
00090 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::implementation (void)
00091 {
00092   return *this->implementation_;
00093 }
00094 
00095 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE CACHING_UTILITY &
00096 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::caching_utility (void)
00097 {
00098   return this->implementation_->caching_utility ();
00099 }
00100 
00101 template<class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION> ACE_INLINE void
00102 ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, IMPLEMENTATION>::dump (void) const
00103 {
00104   ACE_TRACE ("ACE_Caching_Strategy_Adapter::dump");
00105 
00106   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00107   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00108 }
00109 
00110 //////////////////////////////////////////////////////////////////////////////////
00111 
00112 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
00113 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes (void)
00114 {
00115   return this->timer_;
00116 }
00117 
00118 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
00119 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (void)
00120 {
00121   return this->purge_percent_;
00122 }
00123 
00124 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00125 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
00126 {
00127   this->purge_percent_ = percentage;
00128 }
00129 
00130 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00131 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
00132                                                                     const ATTRIBUTES &attr)
00133 {
00134   ACE_UNUSED_ARG (attr);
00135 
00136   if (result == 0)
00137     ++this->timer_;
00138 
00139   return result;
00140 }
00141 
00142 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00143 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
00144                                                                     ATTRIBUTES &attr)
00145 {
00146   if (result == 0)
00147     {
00148       attr = this->timer_;
00149       ++this->timer_;
00150     }
00151 
00152   return result;
00153 }
00154 
00155 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00156 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
00157                                                                       const ATTRIBUTES &attr)
00158 {
00159   ACE_UNUSED_ARG (attr);
00160   return result;
00161 }
00162 
00163 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00164 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
00165                                                                        ATTRIBUTES &attr)
00166 {
00167   ACE_UNUSED_ARG (attr);
00168 
00169   return result;
00170 }
00171 
00172 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00173 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
00174                                                                       const ATTRIBUTES &attr)
00175 {
00176   ACE_UNUSED_ARG (attr);
00177 
00178   if (result == 0)
00179     ++this->timer_;
00180 
00181   return result;
00182 }
00183 
00184 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
00185 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility (void)
00186 {
00187   return this->caching_utility_;
00188 }
00189 
00190 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00191 ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump (void) const
00192 {
00193   ACE_TRACE ("ACE_LRU_Caching_Strategy::dump");
00194 
00195   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00196   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("timer_ = %d "), this->timer_));
00197   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00198 }
00199 
00200 //////////////////////////////////////////////////////////////////////////////////
00201 
00202 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
00203 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes (void)
00204 {
00205   return 0;
00206 }
00207 
00208 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
00209 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (void)
00210 {
00211   return this->purge_percent_;
00212 }
00213 
00214 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00215 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
00216 {
00217   this->purge_percent_ = percentage;
00218 }
00219 
00220 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00221 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
00222                                                                     const ATTRIBUTES &attr)
00223 {
00224   ACE_UNUSED_ARG (attr);
00225 
00226   return result;
00227 }
00228 
00229 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00230 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
00231                                                                     ATTRIBUTES &attr)
00232 {
00233   if (result == 0)
00234     ++attr;
00235 
00236   return result;
00237 }
00238 
00239 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00240 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
00241                                                                        ATTRIBUTES &attr)
00242 {
00243   ACE_UNUSED_ARG (attr);
00244 
00245   return result;
00246 }
00247 
00248 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00249 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
00250                                                                       const ATTRIBUTES &attr)
00251 {
00252   ACE_UNUSED_ARG (attr);
00253 
00254   return result;
00255 }
00256 
00257 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00258 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
00259                                                                       const ATTRIBUTES &attr)
00260 {
00261   ACE_UNUSED_ARG (attr);
00262 
00263   return result;
00264 }
00265 
00266 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
00267 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility (void)
00268 {
00269   return this->caching_utility_;
00270 }
00271 
00272 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00273 ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump (void) const
00274 {
00275   ACE_TRACE ("ACE_LFU_Caching_Strategy::dump");
00276 
00277   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00278   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00279 }
00280 
00281 //////////////////////////////////////////////////////////////////////////////////////
00282 
00283 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
00284 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes (void)
00285 {
00286   return this->order_;
00287 }
00288 
00289 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
00290 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (void)
00291 {
00292   return this->purge_percent_;
00293 }
00294 
00295 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00296 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
00297 {
00298   this->purge_percent_ = percentage;
00299 }
00300 
00301 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00302 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
00303                                                                      const ATTRIBUTES &attr)
00304 {
00305   ACE_UNUSED_ARG (attr);
00306 
00307   if (result == 0)
00308     ++this->order_;
00309 
00310   return result;
00311 }
00312 
00313 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00314 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
00315                                                                      ATTRIBUTES &attr)
00316 {
00317   ACE_UNUSED_ARG (attr);
00318 
00319   return result;
00320 }
00321 
00322 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00323 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
00324                                                                        const ATTRIBUTES &attr)
00325 {
00326   ACE_UNUSED_ARG (attr);
00327 
00328   return result;
00329 }
00330 
00331 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00332 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
00333                                                                         ATTRIBUTES &attr)
00334 {
00335   ACE_UNUSED_ARG (attr);
00336 
00337   return result;
00338 }
00339 
00340 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00341 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
00342                                                                        const ATTRIBUTES &attr)
00343 {
00344   ACE_UNUSED_ARG (attr);
00345 
00346   if (result == 0)
00347     ++this->order_;
00348 
00349   return result;
00350 }
00351 
00352 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
00353 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility (void)
00354 {
00355   return this->caching_utility_;
00356 }
00357 
00358 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00359 ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump (void) const
00360 {
00361   ACE_TRACE ("ACE_FIFO_Caching_Strategy::dump");
00362 
00363   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00364   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("order_ = %d "), this->order_));
00365   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00366 }
00367 
00368 //////////////////////////////////////////////////////////////////////////////////
00369 
00370 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE ATTRIBUTES
00371 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::attributes (void)
00372 {
00373   return 0;
00374 }
00375 
00376 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE double
00377 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (void)
00378 {
00379   return 0;
00380 }
00381 
00382 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00383 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::purge_percent (double percentage)
00384 {
00385   ACE_UNUSED_ARG (percentage);
00386 }
00387 
00388 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00389 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_bind (int result,
00390                                                                      const ATTRIBUTES &attr)
00391 {
00392   ACE_UNUSED_ARG (attr);
00393 
00394   return result;
00395 }
00396 
00397 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00398 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_find (int result,
00399                                                                      ATTRIBUTES &attr)
00400 {
00401   ACE_UNUSED_ARG (attr);
00402 
00403   return result;
00404 }
00405 
00406 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00407 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_unbind (int result,
00408                                                                        const ATTRIBUTES &attr)
00409 {
00410   ACE_UNUSED_ARG (attr);
00411 
00412   return result;
00413 }
00414 
00415 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00416 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_trybind (int result,
00417                                                                         ATTRIBUTES &attr)
00418 {
00419   ACE_UNUSED_ARG (attr);
00420 
00421   return result;
00422 }
00423 
00424 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE int
00425 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::notify_rebind (int result,
00426                                                                        const ATTRIBUTES &attr)
00427 {
00428   ACE_UNUSED_ARG (attr);
00429 
00430   return result;
00431 }
00432 
00433 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE CACHING_UTILITY &
00434 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::caching_utility (void)
00435 {
00436   return this->caching_utility_;
00437 }
00438 
00439 template<class ATTRIBUTES, class CACHING_UTILITY> ACE_INLINE void
00440 ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::dump (void) const
00441 {
00442   ACE_TRACE ("ACE_Null_Caching_Strategy::dump");
00443 
00444   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00445   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00446 }
00447 
00448 //////////////////////////////////////////////////////////////////////////////////

Generated on Mon Jun 16 11:19:18 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002