Public Member Functions | Private Member Functions | Private Attributes

TAO_Notify_Refcountable_Guard_T< T > Class Template Reference

Increments the reference count in the constructor, the count is decremented in the destructor. See Refcountable.h for further notes on usage. More...

#include <Refcountable_Guard_T.h>

Collaboration diagram for TAO_Notify_Refcountable_Guard_T< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_Notify_Refcountable_Guard_T (T *t=0)
 Constructor.
 TAO_Notify_Refcountable_Guard_T (const TAO_Notify_Refcountable_Guard_T< T > &rhs)
 Copy constructor.
 ~TAO_Notify_Refcountable_Guard_T ()
 Destructor.
T * get (void) const
 Redirection operator.
bool isSet (void) const
 Boolean test.
T * operator-> (void) const
 Redirection operator.
T & operator* () const
 Dereference operator.
void reset (T *t=0)
 Reassignment.
TAO_Notify_Refcountable_Guard_T
< T > & 
operator= (const TAO_Notify_Refcountable_Guard_T< T > &rhs)
 Assignment.

Private Member Functions

void swap (TAO_Notify_Refcountable_Guard_T< T > &rhs)

Private Attributes

T * t_

Detailed Description

template<class T>
class TAO_Notify_Refcountable_Guard_T< T >

Increments the reference count in the constructor, the count is decremented in the destructor. See Refcountable.h for further notes on usage.

Definition at line 34 of file Refcountable_Guard_T.h.


Constructor & Destructor Documentation

template<class T>
TAO_Notify_Refcountable_Guard_T< T >::TAO_Notify_Refcountable_Guard_T ( T *  t = 0  )  [explicit]

Constructor.

Definition at line 10 of file Refcountable_Guard_T.inl.

  : t_ (t)
{
  if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_incr_refcnt();
}

Copy constructor.

Definition at line 17 of file Refcountable_Guard_T.inl.

  : t_ (rhs.t_)
{
  if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_incr_refcnt();
}

Destructor.

Definition at line 24 of file Refcountable_Guard_T.inl.

{
  if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_decr_refcnt();
}


Member Function Documentation

template<class T >
T * TAO_Notify_Refcountable_Guard_T< T >::get ( void   )  const

Redirection operator.

Definition at line 31 of file Refcountable_Guard_T.inl.

{
  return this->t_;
}

template<class T >
bool TAO_Notify_Refcountable_Guard_T< T >::isSet ( void   )  const

Boolean test.

Definition at line 38 of file Refcountable_Guard_T.inl.

{
  return ( this->t_ != static_cast< T* >( 0 ) );
}

template<class T >
T & TAO_Notify_Refcountable_Guard_T< T >::operator* ( void   )  const

Dereference operator.

Definition at line 54 of file Refcountable_Guard_T.inl.

{
  ACE_ASSERT ( this->t_ != static_cast< T* >( 0 ) );
  return *this->t_;
}

template<class T >
T * TAO_Notify_Refcountable_Guard_T< T >::operator-> ( void   )  const

Redirection operator.

Definition at line 46 of file Refcountable_Guard_T.inl.

{
  ACE_ASSERT ( this->t_ != static_cast< T* >( 0 ) );
  return this->t_;
}

template<class T>
TAO_Notify_Refcountable_Guard_T< T > & TAO_Notify_Refcountable_Guard_T< T >::operator= ( const TAO_Notify_Refcountable_Guard_T< T > &  rhs  ) 

Assignment.

Definition at line 62 of file Refcountable_Guard_T.inl.

{
  reset( rhs.t_ );
  return *this;
}

template<class T>
void TAO_Notify_Refcountable_Guard_T< T >::reset ( T *  t = 0  ) 

Reassignment.

Definition at line 72 of file Refcountable_Guard_T.inl.

{
  if (this->t_ != t)
  {
    TAO_Notify_Refcountable_Guard_T<T> temp( t );
    swap( temp );
  }
}

template<class T>
void TAO_Notify_Refcountable_Guard_T< T >::swap ( TAO_Notify_Refcountable_Guard_T< T > &  rhs  )  [private]

Definition at line 83 of file Refcountable_Guard_T.inl.

{
  T* temp = this->t_;
  this->t_ = rhs.t_;
  rhs.t_ = temp;
}


Member Data Documentation

template<class T>
T* TAO_Notify_Refcountable_Guard_T< T >::t_ [private]

Definition at line 70 of file Refcountable_Guard_T.h.


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