summaryrefslogtreecommitdiff
path: root/ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl')
-rw-r--r--ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl38
1 files changed, 38 insertions, 0 deletions
diff --git a/ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl b/ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl
new file mode 100644
index 00000000000..26e5026c413
--- /dev/null
+++ b/ACE/TAO/tao/Intrusive_Ref_Count_Base_T.inl
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename T>
+ACE_INLINE
+TAO_Intrusive_Ref_Count_Base<T>::TAO_Intrusive_Ref_Count_Base (void)
+ : ref_count_(1)
+{}
+
+
+template <typename T>
+ACE_INLINE
+void
+TAO_Intrusive_Ref_Count_Base<T>::_add_ref (void)
+{
+ ++this->ref_count_;
+}
+
+
+template <typename T>
+ACE_INLINE
+void
+TAO_Intrusive_Ref_Count_Base<T>::_remove_ref (void)
+{
+ long const new_count = --this->ref_count_;
+
+ if (new_count != 0)
+ {
+ return;
+ }
+
+ delete this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL