Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Cleanup_Strategies_T.cpp
blob004b9c0c0a76d0af9f4479138b6d27e1c8c0783f
1 #ifndef ACE_CLEANUP_STRATEGIES_T_CPP
2 #define ACE_CLEANUP_STRATEGIES_T_CPP
4 #include "ace/Cleanup_Strategies_T.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
7 #pragma once
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 ////////////////////////////////////////////////////////////////////////////
14 template <class KEY, class VALUE, class CONTAINER>
15 ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::~ACE_Cleanup_Strategy ()
19 template <class KEY, class VALUE, class CONTAINER> int
20 ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
21 KEY *key,
22 VALUE *)
24 return container.unbind (*key);
27 ////////////////////////////////////////////////////////////////////////////
29 template <class KEY, class VALUE, class CONTAINER> int
30 ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (
31 CONTAINER &container,
32 KEY *key,
33 VALUE *)
35 VALUE value;
37 if (container.unbind (*key, value) == -1)
38 return -1;
40 value.first->recycler (0, 0);
42 value.first->close ();
44 return 0;
47 /////////////////////////////////////////////////////////////////////////////
49 template <class KEY, class VALUE, class CONTAINER> int
50 ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<KEY,
51 VALUE,
52 CONTAINER>::cleanup (
53 CONTAINER &,
54 KEY *,
55 VALUE *value)
57 return value->first ()->handle_close_i ();
60 ////////////////////////////////////////////////////////////////////////////
62 template <class KEY, class VALUE, class CONTAINER> int
63 ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (
64 CONTAINER &container,
65 KEY *key,
66 VALUE *value)
68 // Remove the item from cache only if the handler isnt in use.
69 if ((*value)->active () == 0)
71 (*value)->close ();
73 if (container.unbind (*key) == -1)
74 return -1;
77 return 0;
80 ////////////////////////////////////////////////////////////////////////////
82 template <class KEY, class VALUE, class CONTAINER> int
83 ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &,
84 KEY *,
85 VALUE *)
87 return 0;
90 ACE_END_VERSIONED_NAMESPACE_DECL
92 #endif /* ACE_CLEANUP_STRATEGIES_T_CPP */