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

Cleanup_Strategies_T.cpp

Go to the documentation of this file.
00001 //$Id: Cleanup_Strategies_T.cpp,v 1.1.1.3 2001/12/04 14:32:59 chad Exp $
00002 
00003 #ifndef CLEANUP_STRATEGIES_T_C
00004 #define CLEANUP_STRATEGIES_T_C
00005 
00006 #include "ace/Cleanup_Strategies_T.h"
00007 
00008 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00009 #define ACE_LACKS_PRAGMA_ONCE
00010 #endif /* ACE_LACKS_PRAGMA_ONCE */
00011 
00012 ACE_RCSID(ace, Cleanup_Strategies_T, "$Id: Cleanup_Strategies_T.cpp,v 1.1.1.3 2001/12/04 14:32:59 chad Exp $")
00013 
00014 ////////////////////////////////////////////////////////////////////////////
00015 
00016 template <class KEY, class VALUE, class CONTAINER> int
00017 ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
00018                                                       KEY *key,
00019                                                       VALUE *value)
00020 {
00021   ACE_UNUSED_ARG (value);
00022 
00023   return container.unbind (*key);
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////////////
00027 
00028 template <class KEY, class VALUE, class CONTAINER> int
00029 ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
00030                                                                          KEY *key,
00031                                                                          VALUE *)
00032 {
00033   VALUE value;
00034 
00035   if (container.unbind (*key, value) == -1)
00036     return -1;
00037 
00038   value.first ()->recycler (0, 0);
00039 
00040   value.first ()->close ();
00041 
00042   return 0;
00043 }
00044 
00045 /////////////////////////////////////////////////////////////////////////////
00046 
00047 template <class KEY, class VALUE, class CONTAINER> int
00048 ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &,
00049                                                                                     KEY *,
00050                                                                                     VALUE *value)
00051 {
00052   return value->first ()->handle_close_i ();
00053 }
00054 
00055 ////////////////////////////////////////////////////////////////////////////
00056 
00057 template <class KEY, class VALUE, class CONTAINER> int
00058 ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
00059                                                               KEY *key,
00060                                                               VALUE *value)
00061 {
00062   // Remove the item from cache only if the handler isnt in use.
00063   if ((*value)->active () == 0)
00064     {
00065       (*value)->close ();
00066 
00067       if (container.unbind (*key) == -1)
00068         return -1;
00069 
00070     }
00071 
00072   return 0;
00073 }
00074 
00075 ////////////////////////////////////////////////////////////////////////////
00076 
00077 template <class KEY, class VALUE, class CONTAINER> int
00078 ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
00079                                                            KEY *key,
00080                                                            VALUE *value)
00081 {
00082   ACE_UNUSED_ARG (container);
00083   ACE_UNUSED_ARG (key);
00084   ACE_UNUSED_ARG (value);
00085 
00086   return 0;
00087 }
00088 
00089 #endif /* CLEANUP_STRATEGIES_T_C */

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