00001
00002
00003 #ifndef ACE_CLEANUP_STRATEGIES_T_CPP
00004 #define ACE_CLEANUP_STRATEGIES_T_CPP
00005
00006 #include "ace/Cleanup_Strategies_T.h"
00007
00008 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00009 #pragma once
00010 #endif
00011
00012 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00013
00014
00015
00016 template <class KEY, class VALUE, class CONTAINER>
00017 ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::~ACE_Cleanup_Strategy (void)
00018 {
00019 }
00020
00021 template <class KEY, class VALUE, class CONTAINER> int
00022 ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
00023 KEY *key,
00024 VALUE *)
00025 {
00026 return container.unbind (*key);
00027 }
00028
00029
00030
00031 template <class KEY, class VALUE, class CONTAINER> int
00032 ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (
00033 CONTAINER &container,
00034 KEY *key,
00035 VALUE *)
00036 {
00037 VALUE value;
00038
00039 if (container.unbind (*key, value) == -1)
00040 return -1;
00041
00042 value.first ()->recycler (0, 0);
00043
00044 value.first ()->close ();
00045
00046 return 0;
00047 }
00048
00049
00050
00051 template <class KEY, class VALUE, class CONTAINER> int
00052 ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<KEY,
00053 VALUE,
00054 CONTAINER>::cleanup (
00055 CONTAINER &,
00056 KEY *,
00057 VALUE *value)
00058 {
00059 return value->first ()->handle_close_i ();
00060 }
00061
00062
00063
00064 template <class KEY, class VALUE, class CONTAINER> int
00065 ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (
00066 CONTAINER &container,
00067 KEY *key,
00068 VALUE *value)
00069 {
00070
00071 if ((*value)->active () == 0)
00072 {
00073 (*value)->close ();
00074
00075 if (container.unbind (*key) == -1)
00076 return -1;
00077
00078 }
00079
00080 return 0;
00081 }
00082
00083
00084
00085 template <class KEY, class VALUE, class CONTAINER> int
00086 ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &,
00087 KEY *,
00088 VALUE *)
00089 {
00090 return 0;
00091 }
00092
00093 ACE_END_VERSIONED_NAMESPACE_DECL
00094
00095 #endif