00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef ACE_CLEANUP_H
00018 # define ACE_CLEANUP_H
00019
00020 # include "ace/pre.h"
00021
00022 # include "ace/config-lite.h"
00023
00024 # if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 # endif
00027
00028 #include "ace/ACE_export.h"
00029
00030 #if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1)
00031 # include "ace/Global_Macros.h"
00032 # define ACE_CLEANUP_DESTROYER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_cleanup_destroyer)
00033 #else
00034 # define ACE_CLEANUP_DESTROYER_NAME ace_cleanup_destroyer
00035 #endif
00036
00037 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00038
00039
00040
00041
00042
00043
00044 class ACE_Export ACE_Cleanup
00045 {
00046 public:
00047
00048 ACE_Cleanup (void);
00049
00050
00051 virtual ~ACE_Cleanup (void);
00052
00053
00054 virtual void cleanup (void *param = 0);
00055 };
00056
00057
00058 extern "C" ACE_Export
00059 void ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *, void *param = 0);
00060
00061
00062
00063
00064
00065
00066 class ACE_Export ACE_Cleanup_Info
00067 {
00068 public:
00069
00070 ACE_Cleanup_Info (void);
00071
00072
00073 bool operator== (const ACE_Cleanup_Info &o) const;
00074
00075
00076 bool operator!= (const ACE_Cleanup_Info &o) const;
00077
00078
00079 void *object_;
00080
00081
00082 ACE_CLEANUP_FUNC cleanup_hook_;
00083
00084
00085 void *param_;
00086 };
00087
00088 class ACE_Cleanup_Info_Node;
00089
00090
00091
00092
00093
00094
00095
00096
00097 class ACE_Export ACE_OS_Exit_Info
00098 {
00099 public:
00100
00101 ACE_OS_Exit_Info (void);
00102
00103
00104 ~ACE_OS_Exit_Info (void);
00105
00106
00107 int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param);
00108
00109
00110
00111 int find (void *object);
00112
00113
00114
00115 void call_hooks ();
00116
00117 private:
00118
00119
00120
00121
00122
00123 ACE_Cleanup_Info_Node *registered_objects_;
00124 };
00125
00126 ACE_END_VERSIONED_NAMESPACE_DECL
00127
00128 # if defined (ACE_HAS_INLINED_OSCALLS)
00129 # if defined (ACE_INLINE)
00130 # undef ACE_INLINE
00131 # endif
00132 # define ACE_INLINE inline
00133 # include "ace/Cleanup.inl"
00134 # endif
00135
00136 # include "ace/post.h"
00137 #endif