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

Cleanup_Strategies_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Cleanup_Strategies_T.h
00006  *
00007  *  $Id: Cleanup_Strategies_T.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef CLEANUP_STRATEGIES_H
00015 #define CLEANUP_STRATEGIES_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 // For linkers that cant grok long names.
00025 #define ACE_Cleanup_Strategy ACLE
00026 
00027 /**
00028  * @class ACE_Cleanup_Strategy
00029  *
00030  * @brief Defines a default strategy to be followed for cleaning up
00031  * entries from a map which is the container.
00032  *
00033  * By default the entry to be cleaned up is removed from the
00034  * container.
00035  */
00036 template <class KEY, class VALUE, class CONTAINER>
00037 class ACE_Cleanup_Strategy
00038 {
00039 
00040 public:
00041 
00042   /// The method which will do the cleanup of the entry in the container.
00043   virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value);
00044 };
00045 
00046 //////////////////////////////////////////////////////////////////////
00047 #define ACE_Recyclable_Handler_Cleanup_Strategy ARHCLE
00048 
00049 /**
00050  * @class ACE_Recyclable_Handler_Cleanup_Strategy
00051  *
00052  * @brief Defines a strategy to be followed for cleaning up
00053  * entries which are svc_handlers from a container.
00054  *
00055  * The entry to be cleaned up is removed from the container.
00056  * Here, since we are dealing with svc_handlers specifically, we
00057  * perform a couple of extra operations. Note: To be used when
00058  * the handler is recyclable.
00059  */
00060 template <class KEY, class VALUE, class CONTAINER>
00061 class ACE_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>
00062 {
00063 
00064 public:
00065 
00066   /// The method which will do the cleanup of the entry in the container.
00067   virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value);
00068 };
00069 
00070 //////////////////////////////////////////////////////////////////////
00071 #define ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy ARRHCLE
00072 
00073 /**
00074  * @class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy
00075  *
00076  * @brief Defines a strategy to be followed for cleaning up
00077  * entries which are svc_handlers from a container.
00078  *
00079  * The entry to be cleaned up is removed from the container.
00080  * Here, since we are dealing with recyclable svc_handlers with
00081  * addresses which are refcountable specifically, we perform a
00082  * couple of extra operations and do so without any locking.
00083  */
00084 template <class KEY, class VALUE, class CONTAINER>
00085 class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>
00086 {
00087 
00088 public:
00089 
00090   /// The method which will do the cleanup of the entry in the container.
00091   virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value);
00092 };
00093 
00094 //////////////////////////////////////////////////////////////////////
00095 
00096 /**
00097  * @class ACE_Handler_Cleanup_Strategy
00098  *
00099  * @brief Defines a strategy to be followed for cleaning up
00100  * entries which are svc_handlers from a container.
00101  *
00102  * The entry to be cleaned up is removed from the container.
00103  * Here, since we are dealing with svc_handlers specifically, we
00104  * perform a couple of extra operations. Note: This cleanup strategy
00105  * should be used in the case when the handler has the caching
00106  * attributes.
00107  */
00108 template <class KEY, class VALUE, class CONTAINER>
00109 class ACE_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>
00110 {
00111 
00112 public:
00113 
00114   /// The method which will do the cleanup of the entry in the container.
00115   virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value);
00116 };
00117 
00118 //////////////////////////////////////////////////////////////////////
00119 #define ACE_Null_Cleanup_Strategy ANCLE
00120 
00121 /**
00122  * @class ACE_Null_Cleanup_Strategy
00123  *
00124  * @brief Defines a do-nothing implementation of the cleanup strategy.
00125  *
00126  * This class simply does nothing at all! Can be used to nullify
00127  * the effect of the Cleanup Strategy.
00128  */
00129 template <class KEY, class VALUE, class CONTAINER>
00130 class ACE_Null_Cleanup_Strategy : public ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>
00131 {
00132 
00133 public:
00134 
00135   /// The dummy cleanup method.
00136   virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value);
00137 };
00138 
00139 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00140 #include "ace/Cleanup_Strategies_T.cpp"
00141 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00142 
00143 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00144 #pragma implementation ("Cleanup_Strategies_T.cpp")
00145 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00146 
00147 #include "ace/post.h"
00148 #endif /* CLEANUP_STRATEGIES_H */

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