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_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE 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.

References TAO_Notify_Refcountable_Guard_T< T >::t_.

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

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

Copy constructor.

Definition at line 17 of file Refcountable_Guard_T.inl.

References TAO_Notify_Refcountable_Guard_T< T >::t_.

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

template<class T>
ACE_INLINE TAO_Notify_Refcountable_Guard_T< T >::~TAO_Notify_Refcountable_Guard_T (  ) 

Destructor.

Definition at line 24 of file Refcountable_Guard_T.inl.

References TAO_Notify_Refcountable_Guard_T< T >::t_.

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


Member Function Documentation

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

Redirection operator.

Definition at line 31 of file Refcountable_Guard_T.inl.

References TAO_Notify_Refcountable_Guard_T< T >::t_.

Referenced by TAO_Notify_Method_Request_Dispatch_No_Copy::copy(), TAO_Notify_Admin::event_channel(), TAO_Notify_Object::get_worker_task(), TAO_Notify_Object::initialize(), TAO_Notify_Event::queueable_copy(), TAO_Notify_ThreadPool_Task::timer(), TAO_Notify_Reactive_Task::timer(), and TAO_Notify_Object::timer().

00032 {
00033   return this->t_;
00034 }

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

Boolean test.

Definition at line 38 of file Refcountable_Guard_T.inl.

Referenced by TAO_Notify_Consumer::assume_pending_events(), TAO_Notify::Routing_Slip::create(), TAO_Notify_Object::execute_task(), and TAO_Notify_Object::shutdown_worker_task().

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

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

Dereference operator.

Definition at line 54 of file Refcountable_Guard_T.inl.

References ACE_ASSERT, and TAO_Notify_Refcountable_Guard_T< T >::t_.

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

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

Redirection operator.

Definition at line 46 of file Refcountable_Guard_T.inl.

References ACE_ASSERT, and TAO_Notify_Refcountable_Guard_T< T >::t_.

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

template<class T>
ACE_INLINE 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.

References TAO_Notify_Refcountable_Guard_T< T >::reset(), and TAO_Notify_Refcountable_Guard_T< T >::t_.

00064 {
00065   reset( rhs.t_ );
00066   return *this;
00067 }

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

Reassignment.

Definition at line 72 of file Refcountable_Guard_T.inl.

References TAO_Notify_Refcountable_Guard_T< T >::swap().

Referenced by TAO_Notify_ThreadPool_Task::init(), TAO_Notify_Reactive_Task::init(), TAO_Notify_ProxySupplier::init(), TAO_Notify_ProxyConsumer::init(), TAO_Notify_EventChannel::init(), TAO_Notify_Admin::init(), TAO_Notify_Refcountable_Guard_T< T >::operator=(), TAO_Notify_Event::queueable_copy(), TAO_Notify_Object::set_event_manager(), TAO_Notify_Object::set_worker_task(), TAO_Notify_Consumer::shutdown(), TAO_Notify_Object::shutdown_worker_task(), TAO_Notify_Consumer::TAO_Notify_Consumer(), and TAO_Notify_Consumer::~TAO_Notify_Consumer().

00073 {
00074   if (this->t_ != t)
00075   {
00076     TAO_Notify_Refcountable_Guard_T<T> temp( t );
00077     swap( temp );
00078   }
00079 }

template<class T>
ACE_INLINE 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.

References TAO_Notify_Refcountable_Guard_T< T >::t_.

Referenced by TAO_Notify_Refcountable_Guard_T< T >::reset().

00085 {
00086   T* temp = this->t_;
00087   this->t_ = rhs.t_;
00088   rhs.t_ = temp;
00089 }


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.

Referenced by TAO_Notify_Refcountable_Guard_T< T >::get(), TAO_Notify_Refcountable_Guard_T< T >::operator *(), TAO_Notify_Refcountable_Guard_T< T >::operator->(), TAO_Notify_Refcountable_Guard_T< T >::operator=(), TAO_Notify_Refcountable_Guard_T< T >::swap(), TAO_Notify_Refcountable_Guard_T< T >::TAO_Notify_Refcountable_Guard_T(), and TAO_Notify_Refcountable_Guard_T< T >::~TAO_Notify_Refcountable_Guard_T().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:29 2010 for TAO_CosNotification by  doxygen 1.4.7