summaryrefslogtreecommitdiff
path: root/ACE/ace/Refcountable.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Refcountable.h')
-rw-r--r--ACE/ace/Refcountable.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/ACE/ace/Refcountable.h b/ACE/ace/Refcountable.h
new file mode 100644
index 00000000000..20670d49506
--- /dev/null
+++ b/ACE/ace/Refcountable.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Refcountable.h
+ *
+ * $Id$
+ *
+ * @author Doug Schmidt
+ */
+//=============================================================================
+#ifndef ACE_REFCOUNTABLE_H
+#define ACE_REFCOUNTABLE_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Refcountable
+ *
+ */
+class ACE_Export ACE_Refcountable
+{
+public:
+ /// Destructor.
+ virtual ~ACE_Refcountable (void);
+
+ // = Increment/Decrement refcount
+ int increment (void);
+ int decrement (void);
+
+ /// Returns the current refcount.
+ int refcount (void) const;
+
+protected:
+ /// Protected constructor.
+ ACE_Refcountable (int refcount);
+
+ /// Current refcount.
+ int refcount_;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined (__ACE_INLINE__)
+#include "ace/Refcountable.inl"
+#endif /* __ACE_INLINE __ */
+
+#include /**/ "ace/post.h"
+#endif /*ACE_REFCOUNTABLE_H*/