TAO_ServantBase_var Class Reference

Auto pointer for reference counting servants. More...

#include <Servant_Base.h>

Collaboration diagram for TAO_ServantBase_var:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_ServantBase_var (void)
 TAO_ServantBase_var (TAO_ServantBase *p)
 TAO_ServantBase_var (const TAO_ServantBase_var &b)
 ~TAO_ServantBase_var (void)
TAO_ServantBase_varoperator= (TAO_ServantBase *p)
TAO_ServantBase_varoperator= (const TAO_ServantBase_var &b)
TAO_ServantBaseoperator-> () const
TAO_ServantBasein (void) const
TAO_ServantBase *& inout (void)
TAO_ServantBase *& out (void)
TAO_ServantBase_retn (void)

Private Attributes

TAO_ServantBaseptr_

Detailed Description

Auto pointer for reference counting servants.

For the convenience of automatically managing servant reference counts, the PortableServer namespace also provides the ServantBase_var class. This class behaves similarly to _var classes for object references (see Section 20.3.1).

Definition at line 192 of file Servant_Base.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_ServantBase_var::TAO_ServantBase_var void   ) 
 

Definition at line 8 of file Servant_Base.i.

00009   : ptr_ (0)
00010 {
00011 }

ACE_INLINE TAO_ServantBase_var::TAO_ServantBase_var TAO_ServantBase p  ) 
 

Definition at line 14 of file Servant_Base.i.

00015   : ptr_ (p)
00016 {
00017 }

TAO_ServantBase_var::TAO_ServantBase_var const TAO_ServantBase_var b  ) 
 

Definition at line 363 of file Servant_Base.cpp.

References TAO_ServantBase::_add_ref(), ACE_CATCHALL, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY_CHECK, and ACE_TRY_NEW_ENV.

00364   : ptr_ (b.ptr_)
00365 {
00366   if (this->ptr_ != 0)
00367     {
00368       ACE_TRY_NEW_ENV
00369         {
00370           this->ptr_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00371           ACE_TRY_CHECK;
00372         }
00373       ACE_CATCHALL
00374         {
00375           ACE_RE_THROW;
00376         }
00377       ACE_ENDTRY;
00378     }
00379 }

TAO_ServantBase_var::~TAO_ServantBase_var void   ) 
 

Definition at line 381 of file Servant_Base.cpp.

References TAO_ServantBase::_remove_ref(), ACE_CATCHALL, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_TRY_CHECK, and ACE_TRY_NEW_ENV.

00382 {
00383   if (this->ptr_ != 0)
00384     {
00385       // We should not allow exceptions to pass through
00386       ACE_TRY_NEW_ENV
00387         {
00388           this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00389           ACE_TRY_CHECK;
00390         }
00391       ACE_CATCHALL
00392         {
00393         }
00394       ACE_ENDTRY;
00395     }
00396 }


Member Function Documentation

TAO_ServantBase * TAO_ServantBase_var::_retn void   ) 
 

Definition at line 475 of file Servant_Base.cpp.

00476 {
00477   TAO_ServantBase *retval = this->ptr_;
00478   this->ptr_ = 0;
00479   return retval;
00480 }

ACE_INLINE TAO_ServantBase * TAO_ServantBase_var::in void   )  const
 

Definition at line 26 of file Servant_Base.i.

Referenced by TAO::Portable_Server::RequestProcessingStrategyDefaultServant::locate_servant(), and TAO::Portable_Server::RequestProcessingStrategyDefaultServant::system_id_to_servant().

00027 {
00028   return this->ptr_;
00029 }

ACE_INLINE TAO_ServantBase *& TAO_ServantBase_var::inout void   ) 
 

Definition at line 32 of file Servant_Base.i.

00033 {
00034   return this->ptr_;
00035 }

ACE_INLINE TAO_ServantBase * TAO_ServantBase_var::operator->  )  const
 

Definition at line 20 of file Servant_Base.i.

00021 {
00022   return this->ptr_;
00023 }

TAO_ServantBase_var & TAO_ServantBase_var::operator= const TAO_ServantBase_var b  ) 
 

Definition at line 424 of file Servant_Base.cpp.

References TAO_ServantBase::_add_ref(), TAO_ServantBase::_remove_ref(), ACE_CATCHALL, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, and ptr_.

00425 {
00426   if (this->ptr_ != b.ptr_)
00427     {
00428       ACE_TRY_NEW_ENV
00429         {
00430           if (this->ptr_ != 0)
00431             {
00432               this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00433               ACE_TRY_CHECK;
00434             }
00435 
00436           if ((this->ptr_ = b.ptr_) != 0)
00437             {
00438               this->ptr_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00439               ACE_TRY_CHECK;
00440             }
00441         }
00442       ACE_CATCHALL
00443         {
00444           ACE_RE_THROW;
00445         }
00446       ACE_ENDTRY;
00447     }
00448 
00449   return *this;
00450 }

TAO_ServantBase_var & TAO_ServantBase_var::operator= TAO_ServantBase p  ) 
 

Definition at line 399 of file Servant_Base.cpp.

References TAO_ServantBase::_remove_ref(), ACE_CATCHALL, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY_CHECK, and ACE_TRY_NEW_ENV.

00400 {
00401   if (this->ptr_ == p)
00402     return *this;
00403 
00404   ACE_TRY_NEW_ENV
00405     {
00406       if (this->ptr_ != 0)
00407         {
00408           this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00409           ACE_TRY_CHECK;
00410         }
00411     }
00412   ACE_CATCHALL
00413     {
00414       ACE_RE_THROW;
00415     }
00416   ACE_ENDTRY;
00417 
00418   this->ptr_ = p;
00419 
00420   return *this;
00421 }

TAO_ServantBase *& TAO_ServantBase_var::out void   ) 
 

Definition at line 453 of file Servant_Base.cpp.

References TAO_ServantBase::_remove_ref(), ACE_CATCHALL, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY_CHECK, and ACE_TRY_NEW_ENV.

00454 {
00455   ACE_TRY_NEW_ENV
00456     {
00457       if (this->ptr_ != 0)
00458         {
00459           this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
00460           ACE_TRY_CHECK;
00461         }
00462     }
00463   ACE_CATCHALL
00464     {
00465       ACE_RE_THROW;
00466     }
00467   ACE_ENDTRY;
00468 
00469   this->ptr_ = 0;
00470 
00471   return this->ptr_;
00472 }


Member Data Documentation

TAO_ServantBase* TAO_ServantBase_var::ptr_ [private]
 

Definition at line 219 of file Servant_Base.h.

Referenced by operator=().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:46:11 2006 for TAO_PortableServer by doxygen 1.3.6