Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Abstract_Manager Class Template Reference

Manager for abstract intefaces. More...

#include <Sequence_T.h>

Collaboration diagram for TAO_Abstract_Manager:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Abstract_Manager (const TAO_Abstract_Manager< T, T_var > &rhs)
 TAO_Abstract_Manager (T **, CORBA::Boolean release)
 ~TAO_Abstract_Manager (void)
 Destructor, only releases the object if <release_> is true. More...

TAO_Abstract_Manager< T, T_var > & operator= (const TAO_Abstract_Manager< T, T_var > &rhs)
TAO_Abstract_Manager< T, T_var > & operator= (T *)
 Assignment from T *. More...

TAO_Abstract_Manager< T, T_var > & operator= (const T_var &)
 Assignment from T_var. More...

T * operator-> (void) const
 Return pointer. More...

 operator const T * () const
 Cast (read-only). More...

 operator T *& ()
 Cast. More...

 operator const T_var () const
 Cast (read-only) so that assignment from a structured type to a T_var will make a copy. More...

T * in (void) const
 for in parameter. More...

T *& inout (void)
 for inout parameter. More...

T *& out (void)
 for out parameter. More...

T * _retn (void)
 for return type. More...


Private Attributes

T ** ptr_
 data member, notice that it is a pointer, to implement the reference behavior for assignment. More...

CORBA::Boolean release_
 release flag based on parent's flag. More...


Detailed Description

template<class T, class T_var>
class TAO_Abstract_Manager< T, T_var >

Manager for abstract intefaces.

An abstract interface can be either a valuetype or an object references, so a manager class is needed.

See also:
TAO_Object_Manager

Definition at line 538 of file Sequence_T.h.


Constructor & Destructor Documentation

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::TAO_Abstract_Manager const TAO_Abstract_Manager< T, T_var > &    rhs
 

Copy constructor, the semantics are non-trivial: + The referenced element is duplicated or not according to the release value on the <rhs>. + In any case a new reference to the same object is created.

Definition at line 431 of file Sequence_T.i.

00434   : ptr_ (rhs.ptr_),
00435     release_ (rhs.release_)
00436 {
00437 }

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::TAO_Abstract_Manager T **   ,
CORBA::Boolean    release
 

Constructor from address of an element, it should be private and only TAO_*_Object_Sequence would use it, but we have some problems with friendship and templates.

Definition at line 440 of file Sequence_T.i.

00443   : ptr_ (buffer),
00444     release_ (release)
00445 {
00446 }

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::~TAO_Abstract_Manager void   
 

Destructor, only releases the object if <release_> is true.

Definition at line 426 of file Sequence_T.i.

00427 {
00428 }


Member Function Documentation

template<class T, class T_var>
ACE_INLINE T * TAO_Abstract_Manager< T, T_var >::_retn void   
 

for return type.

Definition at line 502 of file Sequence_T.i.

References ptr_.

00503 {
00504   T *temp = *this->ptr_;
00505   *this->ptr_ = 0;
00506   return temp;
00507 }

template<class T, class T_var>
ACE_INLINE T * TAO_Abstract_Manager< T, T_var >::in void    const
 

for in parameter.

Definition at line 478 of file Sequence_T.i.

References ptr_.

00479 {
00480   return *this->ptr_;
00481 }

template<class T, class T_var>
ACE_INLINE T *& TAO_Abstract_Manager< T, T_var >::inout void   
 

for inout parameter.

Definition at line 484 of file Sequence_T.i.

References ptr_.

00485 {
00486   return *this->ptr_;
00487 }

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::operator const T *   const
 

Cast (read-only).

Definition at line 466 of file Sequence_T.i.

00467 {
00468   return *this->ptr_;
00469 }

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::operator const T_var   const
 

Cast (read-only) so that assignment from a structured type to a T_var will make a copy.

Definition at line 455 of file Sequence_T.i.

References ptr_.

00456 {
00457   if (*this->ptr_ != 0)
00458     {
00459       (*this->ptr_)->_add_ref ();
00460     }
00461 
00462   return *this->ptr_;
00463 }

template<class T, class T_var>
ACE_INLINE TAO_Abstract_Manager< T, T_var >::operator T *&  
 

Cast.

Definition at line 472 of file Sequence_T.i.

00473 {
00474   return *this->ptr_;
00475 }

template<class T, class T_var>
ACE_INLINE T * TAO_Abstract_Manager< T, T_var >::operator-> void    const
 

Return pointer.

Definition at line 449 of file Sequence_T.i.

References ptr_.

00450 {
00451   return *this->ptr_;
00452 }

template<class T, class T_var>
TAO_Abstract_Manager< T, T_var > & TAO_Abstract_Manager< T, T_var >::operator= const T_var &   
 

Assignment from T_var.

Definition at line 545 of file Sequence_T.cpp.

References ptr_, and release_.

00546 {
00547   if (this->release_)
00548     {
00549       // The semantics of the elements of a sequence are the same as
00550       // that of a var variable.  Therefore we duplicate p's
00551       // pointer before assigning it to the internal
00552       // variable.
00553       if (*this->ptr_ != 0)
00554         {
00555           (*this->ptr_)->_remove_ref ();
00556         }
00557 
00558       *this->ptr_ = p.in ();
00559 
00560       if (p != 0)
00561         {
00562           p->_add_ref ();
00563         }
00564     }
00565   else
00566     {
00567       *this->ptr_ = p.in ();
00568     }
00569 
00570   return *this;
00571 }

template<class T, class T_var>
TAO_Abstract_Manager< T, T_var > & TAO_Abstract_Manager< T, T_var >::operator= T *   
 

Assignment from T *.

Definition at line 520 of file Sequence_T.cpp.

References ptr_, and release_.

00521 {
00522   if (this->release_)
00523     {
00524       // The semantics of the elements of a sequence are the same as
00525       // that of a var variable.  Therefore we will not duplicate the
00526       // user provided pointer before assigning it to the internal
00527       // variable.
00528       if (*this->ptr_ != 0)
00529         {
00530           (*this->ptr_)->_remove_ref ();
00531         }
00532 
00533       *this->ptr_ = p;
00534     }
00535   else
00536     {
00537       *this->ptr_ = p;
00538     }
00539 
00540   return *this;
00541 }

template<class T, class T_var>
TAO_Abstract_Manager< T, T_var > & TAO_Abstract_Manager< T, T_var >::operator= const TAO_Abstract_Manager< T, T_var > &    rhs
 

Assignment from another managed type, only release if <this->release_> is true. @ TODO what happens if rhs.release_ is true an this->relase_ is false?

Definition at line 487 of file Sequence_T.cpp.

References ptr_, and release_.

00490 {
00491   if (this == &rhs)
00492     {
00493       return *this;
00494     }
00495 
00496   if (this->release_)
00497     {
00498       if (*this->ptr_ != 0)
00499         {
00500           (*this->ptr_)->_remove_ref ();
00501         }
00502 
00503       *this->ptr_ = *rhs.ptr_;
00504 
00505       if (*this->ptr_ != 0)
00506         {
00507           (*this->ptr_)->_add_ref ();
00508         }
00509     }
00510   else
00511     {
00512       *this->ptr_ = *rhs.ptr_;
00513     }
00514 
00515   return *this;
00516 }

template<class T, class T_var>
ACE_INLINE T *& TAO_Abstract_Manager< T, T_var >::out void   
 

for out parameter.

Definition at line 490 of file Sequence_T.i.

References ptr_.

00491 {
00492   if (*this->ptr_ != 0)
00493     {
00494       (*this->ptr_)->_remove_ref ();
00495     }
00496 
00497   *this->ptr_ = 0;
00498   return *this->ptr_;
00499 }


Member Data Documentation

template<class T, class T_var>
T** TAO_Abstract_Manager::ptr_ [private]
 

data member, notice that it is a pointer, to implement the reference behavior for assignment.

Definition at line 604 of file Sequence_T.h.

Referenced by _retn, in, inout, operator const T_var, operator->, operator=, and out.

template<class T, class T_var>
CORBA::Boolean TAO_Abstract_Manager::release_ [private]
 

release flag based on parent's flag.

Definition at line 607 of file Sequence_T.h.

Referenced by operator=.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:02:08 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002