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

CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList Class Reference

#include <DomainC.h>

Inheritance diagram for CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList:

Inheritance graph
[legend]
Collaboration diagram for CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList:

Collaboration graph
[legend]
List of all members.

Public Methods

 _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList (void)
 _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList (CORBA::ULong maximum)
 _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList (CORBA::ULong maximum, CORBA::ULong length, DomainManager **value, CORBA::Boolean release=0)
 _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList (const _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList &rhs)
_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList & operator= (const _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList &rhs)
virtual ~_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList (void)
TAO_Object_Manager< CORBA::DomainManager,
CORBA::DomainManager_var
operator[] (CORBA::ULong index) const
virtual void _allocate_buffer (CORBA::ULong length)
virtual void _deallocate_buffer (void)
 Must deallocate the buffer and then set it to zero. More...

DomainManager ** get_buffer (CORBA::Boolean orphan=0)
const DomainManager ** get_buffer (void) const
virtual void _shrink_buffer (CORBA::ULong nl, CORBA::ULong ol)
virtual void _downcast (void *target, CORBA_Object *src ACE_ENV_ARG_DECL_WITH_DEFAULTS)
 Used for sequences of objects to downcast a recently demarshalled object reference into the right type. More...

virtual CORBA_Object_upcast (void *src) const
 Used for sequences of object to convert from the derived type into the Object class. More...


Static Public Methods

DomainManager ** allocbuf (CORBA::ULong nelems)
void freebuf (DomainManager **buffer)

Constructor & Destructor Documentation

ACE_INLINE CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList void   
 

Definition at line 88 of file DomainC.i.

00089 {
00090 }

ACE_INLINE CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList CORBA::ULong    maximum
 

Definition at line 93 of file DomainC.i.

00094   : TAO_Unbounded_Base_Sequence (maximum, _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (maximum))
00095 {
00096 }

ACE_INLINE CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList CORBA::ULong    maximum,
CORBA::ULong    length,
DomainManager **    value,
CORBA::Boolean    release = 0
 

Definition at line 99 of file DomainC.i.

00103 : TAO_Unbounded_Base_Sequence (maximum, length, value, release)
00104 {
00105 }

ACE_INLINE CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList const _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList &    rhs
 

Definition at line 108 of file DomainC.i.

References CORBA::DomainManager::_duplicate, and TAO_Base_Sequence::buffer_.

00109   : TAO_Unbounded_Base_Sequence (rhs)
00110 {
00111   if (rhs.buffer_ != 0)
00112   {
00113     CORBA::DomainManager **tmp1 = _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (this->maximum_);
00114     CORBA::DomainManager ** const tmp2 = ACE_reinterpret_cast (CORBA::DomainManager ** ACE_CAST_CONST, rhs.buffer_);
00115     
00116     for (CORBA::ULong i = 0; i < rhs.length_; ++i)
00117       {
00118         tmp1[i] = CORBA::DomainManager::_duplicate (tmp2[i]);
00119       }
00120     
00121     this->buffer_ = tmp1;
00122   }
00123   else
00124   {
00125     this->buffer_ = 0;
00126   }
00127 }

CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::~_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList void    [virtual]
 

Definition at line 1665 of file DomainC.cpp.

References _deallocate_buffer.

01666 {
01667   this->_deallocate_buffer ();
01668 }


Member Function Documentation

void CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_allocate_buffer CORBA::ULong    length [virtual]
 

Ensure that the buffer contains space for at least <length> elements. The constructor must be called for any new elements, the old ones (if any) must be copied into the buffer using operator= and then their destructors must be called. Finally the old buffer must be released.

Implements TAO_Base_Sequence.

Definition at line 1620 of file DomainC.cpp.

References CORBA::DomainManager::_duplicate, TAO_Base_Sequence::buffer_, TAO_Unbounded_Base_Sequence::length, TAO_Base_Sequence::length_, and TAO_Base_Sequence::release_.

01621 {
01622   CORBA::DomainManager **tmp = 0;
01623   tmp = _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (length);
01624   
01625   if (this->buffer_ != 0)
01626   {
01627     CORBA::DomainManager **old = ACE_reinterpret_cast (CORBA::DomainManager**, this->buffer_);
01628     for (CORBA::ULong i = 0; i < this->length_; ++i)
01629       {
01630         if (!this->release_)
01631           {
01632             tmp[i] = CORBA::DomainManager::_duplicate (old[i]);
01633           }
01634         else
01635           {
01636             tmp[i] = old[i];
01637           }
01638       }
01639     
01640     if (this->release_)
01641       {
01642         delete[] old;
01643       }
01644   }
01645   this->buffer_ = tmp;
01646 }

void CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_deallocate_buffer void    [virtual]
 

Must deallocate the buffer and then set it to zero.

Implements TAO_Base_Sequence.

Definition at line 1649 of file DomainC.cpp.

References CORBA::DomainManager::_nil, TAO_Base_Sequence::buffer_, TAO_Base_Sequence::length_, CORBA::release, and TAO_Base_Sequence::release_.

Referenced by ~_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList.

01650 {
01651   if (this->buffer_ == 0 || this->release_ == 0)
01652     return;
01653   CORBA::DomainManager **tmp = ACE_reinterpret_cast (CORBA::DomainManager**, this->buffer_);
01654   
01655   for (CORBA::ULong i = 0; i < this->length_; ++i)
01656     {
01657       CORBA::release (tmp[i]);
01658       tmp[i] = CORBA::DomainManager::_nil ();
01659     }
01660   
01661   _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::freebuf (tmp);
01662   this->buffer_ = 0;
01663 }

void CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_downcast void *    target,
CORBA_Object *src    ACE_ENV_ARG_DECL_WITH_DEFAULTS
[virtual]
 

Used for sequences of objects to downcast a recently demarshalled object reference into the right type.

Reimplemented from TAO_Base_Sequence.

Definition at line 1683 of file DomainC.cpp.

References CORBA::DomainManager::_narrow, ACE_CHECK, ACE_ENV_ARG_DECL, and ACE_ENV_ARG_PARAMETER.

01688 {
01689   CORBA::DomainManager **tmp = ACE_static_cast (CORBA::DomainManager**, target);
01690   *tmp = CORBA::DomainManager::_narrow (src ACE_ENV_ARG_PARAMETER);
01691   ACE_CHECK;
01692 }

void CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_shrink_buffer CORBA::ULong    nl,
CORBA::ULong    ol
[virtual]
 

Some sequences (of objects and strings) require some cleanup if the sequence is shrunk. The spec requires the destructor to release the objects only from position <0> to <length-1>; so shrink and then delete could result in a memory leak.

Reimplemented from TAO_Base_Sequence.

Definition at line 1671 of file DomainC.cpp.

References CORBA::DomainManager::_nil, and CORBA::release.

01672 {
01673   CORBA::DomainManager **tmp = ACE_reinterpret_cast (CORBA::DomainManager**, this->buffer_);
01674   
01675   for (CORBA::ULong i = nl; i < ol; ++i)
01676     {
01677       CORBA::release (tmp[i]);
01678       tmp[i] = CORBA::DomainManager::_nil ();
01679     }
01680 }

CORBA_Object * CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::_upcast void *    src const [virtual]
 

Used for sequences of object to convert from the derived type into the Object class.

Reimplemented from TAO_Base_Sequence.

Definition at line 1695 of file DomainC.cpp.

01696 {
01697   CORBA::DomainManager **tmp = ACE_static_cast (CORBA::DomainManager**, src);
01698   return *tmp;
01699 }

ACE_INLINE CORBA::DomainManager ** CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf CORBA::ULong    nelems [static]
 

Definition at line 65 of file DomainC.i.

References CORBA::DomainManager::_nil, and ACE_NEW_RETURN.

00066 {
00067   CORBA::DomainManager **buf = 0;
00068   
00069   ACE_NEW_RETURN (buf, CORBA::DomainManager*[nelems], 0);
00070   
00071   for (CORBA::ULong i = 0; i < nelems; i++)
00072     {
00073       buf[i] = CORBA::DomainManager::_nil ();
00074     }
00075   
00076   return buf;
00077 }

ACE_INLINE void CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::freebuf DomainManager **    buffer [static]
 

Definition at line 80 of file DomainC.i.

00081 {
00082   if (buffer == 0)
00083     return;
00084   delete[] buffer;
00085 }

ACE_INLINE const CORBA::DomainManager ** CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::get_buffer void    const
 

Definition at line 210 of file DomainC.i.

00211 {
00212   return ACE_reinterpret_cast(const CORBA::DomainManager ** ACE_CAST_CONST, this->buffer_);
00213 }

ACE_INLINE CORBA::DomainManager ** CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::get_buffer CORBA::Boolean    orphan = 0
 

Definition at line 176 of file DomainC.i.

References TAO_Base_Sequence::buffer_, TAO_Base_Sequence::length_, TAO_Base_Sequence::maximum_, and TAO_Base_Sequence::release_.

00177 {
00178   CORBA::DomainManager **result = 0;
00179   if (orphan == 0)
00180   {
00181     // We retain ownership.
00182     if (this->buffer_ == 0)
00183     {
00184       result = _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (this->maximum_);
00185       this->buffer_ = result;
00186       this->release_ = 1;
00187     }
00188     else
00189     {
00190       result = ACE_reinterpret_cast (CORBA::DomainManager**, this->buffer_);
00191     }
00192   }
00193   else // if (orphan == 1)
00194   {
00195     if (this->release_ != 0)
00196     {
00197       // We set the state back to default and relinquish
00198       // ownership.
00199       result = ACE_reinterpret_cast(CORBA::DomainManager**,this->buffer_);
00200       this->maximum_ = 0;
00201       this->length_ = 0;
00202       this->buffer_ = 0;
00203       this->release_ = 0;
00204     }
00205   }
00206   return result;
00207 }

ACE_INLINE CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList & CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::operator= const _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList &    rhs
 

Definition at line 130 of file DomainC.i.

References CORBA::DomainManager::_duplicate, CORBA::DomainManager::_nil, TAO_Base_Sequence::buffer_, TAO_Base_Sequence::length_, TAO_Base_Sequence::maximum_, TAO_Base_Sequence::operator=, CORBA::release, and TAO_Base_Sequence::release_.

00131 {
00132   if (this == &rhs)
00133     return *this;
00134   
00135   if (this->release_)
00136   {
00137     CORBA::DomainManager **tmp = ACE_reinterpret_cast (CORBA::DomainManager **, this->buffer_);
00138     
00139     for (CORBA::ULong i = 0; i < this->length_; ++i)
00140     {
00141       CORBA::release (tmp[i]);
00142       tmp[i] = CORBA::DomainManager::_nil ();
00143     }
00144     if (this->maximum_ < rhs.maximum_)
00145     {
00146       _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::freebuf (tmp);
00147       this->buffer_ = _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (rhs.maximum_);
00148     }
00149   }
00150   else
00151     this->buffer_ = _TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::allocbuf (rhs.maximum_);
00152   
00153   TAO_Unbounded_Base_Sequence::operator= (rhs);
00154   
00155   CORBA::DomainManager **tmp1 = ACE_reinterpret_cast (CORBA::DomainManager **, this->buffer_);
00156   CORBA::DomainManager ** const tmp2 = ACE_reinterpret_cast (CORBA::DomainManager ** ACE_CAST_CONST, rhs.buffer_);
00157   
00158   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
00159     {
00160       tmp1[i] = CORBA::DomainManager::_duplicate (tmp2[i]);
00161     }
00162   
00163   return *this;
00164 }

ACE_INLINE TAO_Object_Manager< CORBA::DomainManager, CORBA::DomainManager_var > CORBA::_TAO_Unbounded_Object_Sequence_CORBA_DomainManagerList::operator[] CORBA::ULong    index const
 

Definition at line 167 of file DomainC.i.

References ACE_ASSERT.

00169 {
00170   ACE_ASSERT (index < this->maximum_);
00171   CORBA::DomainManager ** const tmp = ACE_reinterpret_cast (CORBA::DomainManager ** ACE_CAST_CONST, this->buffer_);
00172   return TAO_Object_Manager<CORBA::DomainManager,CORBA::DomainManager_var> (tmp + index, this->release_);
00173 }


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