3 //=============================================================================
5 * @file Cleanup_Strategies_T.h
7 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
9 //=============================================================================
11 #ifndef CLEANUP_STRATEGIES_H
12 #define CLEANUP_STRATEGIES_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 // For linkers that cant grok long names.
22 #define ACE_Cleanup_Strategy ACLE
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class ACE_Cleanup_Strategy
29 * @brief Defines a default strategy to be followed for cleaning up
30 * entries from a map which is the container.
32 * By default the entry to be cleaned up is removed from the
35 template <class KEY
, class VALUE
, class CONTAINER
>
36 class ACE_Cleanup_Strategy
40 virtual ~ACE_Cleanup_Strategy ();
42 /// The method which will do the cleanup of the entry in the container.
43 virtual int cleanup (CONTAINER
&container
, KEY
*key
, VALUE
*value
);
46 //////////////////////////////////////////////////////////////////////
47 #define ACE_Recyclable_Handler_Cleanup_Strategy ARHCLE
50 * @class ACE_Recyclable_Handler_Cleanup_Strategy
52 * @brief Defines a strategy to be followed for cleaning up
53 * entries which are svc_handlers from a container.
55 * The entry to be cleaned up is removed from the container.
56 * Here, since we are dealing with svc_handlers specifically, we
57 * perform a couple of extra operations. @note To be used when
58 * the handler is recyclable.
60 template <class KEY
, class VALUE
, class CONTAINER
>
61 class ACE_Recyclable_Handler_Cleanup_Strategy
: public ACE_Cleanup_Strategy
<KEY
, VALUE
, CONTAINER
>
64 /// The method which will do the cleanup of the entry in the container.
65 virtual int cleanup (CONTAINER
&container
, KEY
*key
, VALUE
*value
);
68 //////////////////////////////////////////////////////////////////////
69 #define ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy ARRHCLE
72 * @class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy
74 * @brief Defines a strategy to be followed for cleaning up
75 * entries which are svc_handlers from a container.
77 * The entry to be cleaned up is removed from the container.
78 * Here, since we are dealing with recyclable svc_handlers with
79 * addresses which are refcountable specifically, we perform a
80 * couple of extra operations and do so without any locking.
82 template <class KEY
, class VALUE
, class CONTAINER
>
83 class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy
: public ACE_Cleanup_Strategy
<KEY
, VALUE
, CONTAINER
>
86 /// The method which will do the cleanup of the entry in the container.
87 virtual int cleanup (CONTAINER
&container
, KEY
*key
, VALUE
*value
);
90 //////////////////////////////////////////////////////////////////////
93 * @class ACE_Handler_Cleanup_Strategy
95 * @brief Defines a strategy to be followed for cleaning up
96 * entries which are svc_handlers from a container.
98 * The entry to be cleaned up is removed from the container.
99 * Here, since we are dealing with svc_handlers specifically, we
100 * perform a couple of extra operations. @note This cleanup strategy
101 * should be used in the case when the handler has the caching
104 template <class KEY
, class VALUE
, class CONTAINER
>
105 class ACE_Handler_Cleanup_Strategy
: public ACE_Cleanup_Strategy
<KEY
, VALUE
, CONTAINER
>
108 /// The method which will do the cleanup of the entry in the container.
109 virtual int cleanup (CONTAINER
&container
, KEY
*key
, VALUE
*value
);
112 //////////////////////////////////////////////////////////////////////
113 #define ACE_Null_Cleanup_Strategy ANCLE
116 * @class ACE_Null_Cleanup_Strategy
118 * @brief Defines a do-nothing implementation of the cleanup strategy.
120 * This class simply does nothing at all! Can be used to nullify
121 * the effect of the Cleanup Strategy.
123 template <class KEY
, class VALUE
, class CONTAINER
>
124 class ACE_Null_Cleanup_Strategy
: public ACE_Cleanup_Strategy
<KEY
, VALUE
, CONTAINER
>
127 /// The dummy cleanup method.
128 virtual int cleanup (CONTAINER
&container
, KEY
*key
, VALUE
*value
);
131 ACE_END_VERSIONED_NAMESPACE_DECL
133 #include "ace/Cleanup_Strategies_T.cpp"
135 #include /**/ "ace/post.h"
136 #endif /* CLEANUP_STRATEGIES_H */