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

TAO_Pseudo_Object_Manager Class Template Reference

Manager for Pseudo Objects. More...

#include <Sequence_T.h>

Collaboration diagram for TAO_Pseudo_Object_Manager:

Collaboration graph
[legend]
List of all members.

Public Methods

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

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

TAO_Pseudo_Object_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...

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


Friends

class TAO_Unbounded_Pseudo_Sequence< T, T_var >

Detailed Description

template<class T, class T_var>
class TAO_Pseudo_Object_Manager< T, T_var >

Manager for Pseudo Objects.

Definition at line 363 of file Sequence_T.h.


Constructor & Destructor Documentation

template<class T, class T_var>
ACE_INLINE TAO_Pseudo_Object_Manager< T, T_var >::TAO_Pseudo_Object_Manager const TAO_Pseudo_Object_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 281 of file Sequence_T.i.

00282   : ptr_ (rhs.ptr_),
00283     release_ (rhs.release_)
00284 {
00285 }

template<class T, class T_var>
ACE_INLINE TAO_Pseudo_Object_Manager< T, T_var >::TAO_Pseudo_Object_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 289 of file Sequence_T.i.

00290   : ptr_ (buffer),
00291     release_ (release)
00292 {
00293 }

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

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

Definition at line 275 of file Sequence_T.i.

00276 {
00277 }


Member Function Documentation

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

for return type.

Definition at line 334 of file Sequence_T.i.

References ptr_.

00335 {
00336   T *temp = *this->ptr_;
00337   *this->ptr_ = T::_nil ();
00338   return temp;
00339 }

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

for in parameter.

Definition at line 314 of file Sequence_T.i.

References ptr_.

00315 {
00316   return *this->ptr_;
00317 }

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

for inout parameter.

Definition at line 320 of file Sequence_T.i.

References ptr_.

00321 {
00322   return *this->ptr_;
00323 }

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

Cast (read-only).

Definition at line 302 of file Sequence_T.i.

00303 {
00304   return *this->ptr_;
00305 }

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

Cast.

Definition at line 308 of file Sequence_T.i.

00309 {
00310   return *this->ptr_;
00311 }

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

Return pointer.

Definition at line 296 of file Sequence_T.i.

References ptr_.

00297 {
00298   return *this->ptr_;
00299 }

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

Assignment from T_var.

Definition at line 385 of file Sequence_T.cpp.

References ptr_, CORBA::release, and release_.

00386 {
00387   if (this->release_)
00388     {
00389       // The semantics of the elements of a sequence are the same as
00390       // that of a var variable.  Therefore we duplicate p's
00391       // pointer before assigning it to the internal
00392       // variable.
00393       CORBA::release (*this->ptr_);
00394       *this->ptr_ = T::_duplicate (p.in ());
00395     }
00396   else
00397     {
00398       *this->ptr_ = p.in ();
00399     }
00400 
00401   return *this;
00402 }

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

Assignment from T *.

Definition at line 365 of file Sequence_T.cpp.

References ptr_, CORBA::release, and release_.

00366 {
00367   if (this->release_)
00368     {
00369       // The semantics of the elements of a sequence are the same as
00370       // that of a var variable.  Therefore we will not duplicate the
00371       // user provided pointer before assigning it to the internal
00372       // variable.  However, we will release it.
00373       CORBA::release (*this->ptr_);
00374       *this->ptr_ = p;
00375     }
00376   else
00377     {
00378       *this->ptr_ = p;
00379     }
00380 
00381   return *this;
00382 }

template<class T, class T_var>
TAO_Pseudo_Object_Manager< T, T_var > & TAO_Pseudo_Object_Manager< T, T_var >::operator= const TAO_Pseudo_Object_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 342 of file Sequence_T.cpp.

References ptr_, CORBA::release, and release_.

00345 {
00346   if (this == &rhs)
00347     {
00348       return *this;
00349     }
00350 
00351   if (this->release_)
00352     {
00353       CORBA::release (*this->ptr_);
00354       *this->ptr_ = T::_duplicate (*rhs.ptr_);
00355     }
00356   else
00357     {
00358       *this->ptr_ = *rhs.ptr_;
00359     }
00360 
00361   return *this;
00362 }

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

for out parameter.

Definition at line 326 of file Sequence_T.i.

References ptr_, and CORBA::release.

00327 {
00328   CORBA::release (*this->ptr_);
00329   *this->ptr_ = T::_nil ();
00330   return *this->ptr_;
00331 }


Friends And Related Function Documentation

template<class T, class T_var>
friend class TAO_Unbounded_Pseudo_Sequence< T, T_var > [friend]
 

Definition at line 365 of file Sequence_T.h.


Member Data Documentation

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

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

Definition at line 429 of file Sequence_T.h.

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

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

release flag based on parent's flag.

Definition at line 432 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:37:34 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002