summaryrefslogtreecommitdiff
path: root/ace/Thread_Exit.h
diff options
context:
space:
mode:
authorjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-03 17:42:20 +0000
committerjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-03 17:42:20 +0000
commitb6d456c9d6cbbdf2052e4058aa1f5e8a6ee5c466 (patch)
tree2b4cfe48c805615a7494776b2625017666c90802 /ace/Thread_Exit.h
parent26748c3516744d69e95ad82a5a9948b080d84618 (diff)
downloadATCD-b6d456c9d6cbbdf2052e4058aa1f5e8a6ee5c466.tar.gz
Altered code to use a smartish pointer.
Diffstat (limited to 'ace/Thread_Exit.h')
-rw-r--r--ace/Thread_Exit.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/ace/Thread_Exit.h b/ace/Thread_Exit.h
index 1df6538dc9e..6bb692a09b5 100644
--- a/ace/Thread_Exit.h
+++ b/ace/Thread_Exit.h
@@ -74,5 +74,33 @@ private:
// We don't follow the singleton pattern due to dependency issues.
};
+class ACE_Export ACE_Thread_Exit_Maybe
+ // = TITLE
+ // A version of ACE_Thread_Exit that is created dynamically
+ // under the hood if the flag is set to TRUE.
+ // = DESCRIPTION
+ // Allows the appearance of a "smart pointer", but is not
+ // always created.
+{
+public:
+ ACE_Thread_Exit_Maybe (int flag = 0);
+ // Don't create an ACE_Thread_Exit instance by default.
+
+ ~ACE_Thread_Exit_Maybe (void);
+ // Destroys the underlying ACE_Thread_Exit instance if it exists.
+
+ ACE_Thread_Exit * operator -> (void) const;
+ // Delegates to underlying instance.
+
+ ACE_Thread_Exit * instance (void) const;
+ // Returns the underlying instance.
+
+private:
+
+ ACE_Thread_Exit *instance_;
+ // Holds the underlying instance.
+
+};
+
#include "ace/post.h"
#endif /* ACE_THREAD_EXIT_H */