Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

TAO_Intrusive_Ref_Count_Base< ACE_LOCK > Class Template Reference

Template base class to provide intrusive reference-counting to subclasses. This makes the subclass capable of using a TAO_Intrusive_Ref_Count_Handle<X> class as a smart-pointer to an X object. In this case, X is a sub-class of this class, TAO_Intrusive_Ref_Count_Base<ACE_LOCK>. The ACE_LOCK type is used to protect the atomic reference count data member. More...

#include <Intrusive_Ref_Count_Base_T.h>

Inheritance diagram for TAO_Intrusive_Ref_Count_Base< ACE_LOCK >:
Inheritance graph
[legend]
Collaboration diagram for TAO_Intrusive_Ref_Count_Base< ACE_LOCK >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~TAO_Intrusive_Ref_Count_Base (void)
void _add_ref (void)
void _remove_ref (void)

Protected Member Functions

 TAO_Intrusive_Ref_Count_Base (void)

Private Member Functions

 TAO_Intrusive_Ref_Count_Base (const TAO_Intrusive_Ref_Count_Base &)
TAO_Intrusive_Ref_Count_Baseoperator= (const TAO_Intrusive_Ref_Count_Base &)

Private Attributes

ACE_Atomic_Op< ACE_LOCK, long > ref_count_

Detailed Description

template<class ACE_LOCK>
class TAO_Intrusive_Ref_Count_Base< ACE_LOCK >

Template base class to provide intrusive reference-counting to subclasses. This makes the subclass capable of using a TAO_Intrusive_Ref_Count_Handle<X> class as a smart-pointer to an X object. In this case, X is a sub-class of this class, TAO_Intrusive_Ref_Count_Base<ACE_LOCK>. The ACE_LOCK type is used to protect the atomic reference count data member.

Definition at line 40 of file Intrusive_Ref_Count_Base_T.h.


Constructor & Destructor Documentation

template<typename T >
TAO_Intrusive_Ref_Count_Base< T >::~TAO_Intrusive_Ref_Count_Base ( void   )  [virtual]

Definition at line 15 of file Intrusive_Ref_Count_Base_T.cpp.

{
}

template<typename T >
TAO_Intrusive_Ref_Count_Base< T >::TAO_Intrusive_Ref_Count_Base ( void   )  [protected]

Definition at line 9 of file Intrusive_Ref_Count_Base_T.inl.

  : ref_count_(1)
{}

template<class ACE_LOCK>
TAO_Intrusive_Ref_Count_Base< ACE_LOCK >::TAO_Intrusive_Ref_Count_Base ( const TAO_Intrusive_Ref_Count_Base< ACE_LOCK > &   )  [private]

Member Function Documentation

template<typename T >
void TAO_Intrusive_Ref_Count_Base< T >::_add_ref ( void   ) 

Definition at line 17 of file Intrusive_Ref_Count_Base_T.inl.

{
  ++this->ref_count_;
}

template<typename T >
void TAO_Intrusive_Ref_Count_Base< T >::_remove_ref ( void   ) 

Definition at line 26 of file Intrusive_Ref_Count_Base_T.inl.

{
  long const new_count = --this->ref_count_;

  if (new_count != 0)
    {
      return;
    }

  delete this;
}

template<class ACE_LOCK>
TAO_Intrusive_Ref_Count_Base& TAO_Intrusive_Ref_Count_Base< ACE_LOCK >::operator= ( const TAO_Intrusive_Ref_Count_Base< ACE_LOCK > &   )  [private]

Member Data Documentation

template<class ACE_LOCK>
ACE_Atomic_Op<ACE_LOCK, long> TAO_Intrusive_Ref_Count_Base< ACE_LOCK >::ref_count_ [private]

Definition at line 57 of file Intrusive_Ref_Count_Base_T.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines