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

CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq Class Reference

#include <Policy_ForwardC.h>

Inheritance diagram for CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq (void)
 _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq (CORBA::ULong maximum)
 _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq (CORBA::ULong maximum, CORBA::ULong length, CORBA::ULong *data, CORBA::Boolean release=0)
 _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq (const _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq &rhs)
_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq & operator= (const _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq &rhs)
virtual ~_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq (void)
CORBA::ULongoperator[] (CORBA::ULong i)
const CORBA::ULongoperator[] (CORBA::ULong i) const
virtual void _allocate_buffer (CORBA::ULong length)
virtual void _deallocate_buffer (void)
 Must deallocate the buffer and then set it to zero. More...

CORBA::ULongget_buffer (CORBA::Boolean orphan=0)
const CORBA::ULongget_buffer (void) const
void replace (CORBA::ULong max, CORBA::ULong length, CORBA::ULong *data, CORBA::Boolean release)

Static Public Methods

CORBA::ULongallocbuf (CORBA::ULong size)
void freebuf (CORBA::ULong *buffer)

Constructor & Destructor Documentation

ACE_INLINE CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq void   
 

Definition at line 419 of file Policy_ForwardC.i.

00420 {
00421 }

ACE_INLINE CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq CORBA::ULong    maximum
 

Definition at line 424 of file Policy_ForwardC.i.

00425   : TAO_Unbounded_Base_Sequence (maximum, _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (maximum))
00426 {
00427 }

ACE_INLINE CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq CORBA::ULong    maximum,
CORBA::ULong    length,
CORBA::ULong   data,
CORBA::Boolean    release = 0
 

Definition at line 430 of file Policy_ForwardC.i.

00434 : TAO_Unbounded_Base_Sequence (maximum, length, data, release)
00435 {
00436 }

ACE_INLINE CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq const _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq &    rhs
 

Definition at line 439 of file Policy_ForwardC.i.

00441   : TAO_Unbounded_Base_Sequence (rhs)
00442 {
00443   if (rhs.buffer_ != 0)
00444   {
00445     CORBA::ULong *tmp1 = _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (this->maximum_);
00446     CORBA::ULong * const tmp2 = ACE_reinterpret_cast (CORBA::ULong * ACE_CAST_CONST, rhs.buffer_);
00447     
00448     for (CORBA::ULong i = 0; i < this->length_; ++i)
00449       tmp1[i] = tmp2[i];
00450     
00451     this->buffer_ = tmp1;
00452   }
00453   else
00454   {
00455     this->buffer_ = 0;
00456   }
00457 }

CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::~_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq void    [virtual]
 

Definition at line 308 of file Policy_ForwardC.cpp.

00309 {
00310   this->_deallocate_buffer ();
00311 }


Member Function Documentation

void CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_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 277 of file Policy_ForwardC.cpp.

References TAO_Base_Sequence::buffer_, TAO_Unbounded_Base_Sequence::length, TAO_Base_Sequence::length_, and TAO_Base_Sequence::release_.

00278 {
00279   CORBA::ULong* tmp = 0;
00280   tmp = _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (length);
00281   
00282   if (this->buffer_ != 0)
00283   {
00284     CORBA::ULong *old = ACE_reinterpret_cast (CORBA::ULong *,this->buffer_);
00285     
00286     for (CORBA::ULong i = 0; i < this->length_; ++i)
00287       tmp[i] = old[i];
00288     
00289     if (this->release_)
00290       _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::freebuf (old);
00291     
00292   }
00293   this->buffer_ = tmp;
00294 }

void CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::_deallocate_buffer void    [virtual]
 

Must deallocate the buffer and then set it to zero.

Implements TAO_Base_Sequence.

Definition at line 297 of file Policy_ForwardC.cpp.

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

00298 {
00299   if (this->buffer_ == 0 || this->release_ == 0)
00300     return;
00301   
00302   CORBA::ULong *tmp = ACE_reinterpret_cast (CORBA::ULong *,this->buffer_);
00303   
00304   _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::freebuf (tmp);
00305   this->buffer_ = 0;
00306 } 

ACE_INLINE CORBA::ULong * CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf CORBA::ULong    size [static]
 

Definition at line 404 of file Policy_ForwardC.i.

References ACE_NEW_RETURN.

00406 {
00407   CORBA::ULong *retval = 0;
00408   ACE_NEW_RETURN (retval, CORBA::ULong[size], 0);
00409   return retval;
00410 }

ACE_INLINE void CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::freebuf CORBA::ULong   buffer [static]
 

Definition at line 412 of file Policy_ForwardC.i.

References ACE_INLINE.

00414 {
00415   delete [] buffer;
00416 }

ACE_INLINE const CORBA::ULong * CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::get_buffer void    const
 

Definition at line 546 of file Policy_ForwardC.i.

00547 {
00548   return ACE_reinterpret_cast(const CORBA::ULong * ACE_CAST_CONST, this->buffer_);
00549 }

ACE_INLINE CORBA::ULong * CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::get_buffer CORBA::Boolean    orphan = 0
 

Definition at line 512 of file Policy_ForwardC.i.

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

Referenced by operator<<, and operator>>.

00513 {
00514   CORBA::ULong *result = 0;
00515   if (orphan == 0)
00516   {
00517     // We retain ownership.
00518     if (this->buffer_ == 0)
00519     {
00520       result = _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (this->length_);
00521       this->buffer_ = result;
00522       this->release_ = 1;
00523     }
00524     else
00525     {
00526       result = ACE_reinterpret_cast (CORBA::ULong*, this->buffer_);
00527     }
00528   }
00529   else // if (orphan == 1)
00530   {
00531     if (this->release_ != 0)
00532     {
00533       // We set the state back to default and relinquish
00534       // ownership.
00535       result = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00536       this->maximum_ = 0;
00537       this->length_ = 0;
00538       this->buffer_ = 0;
00539       this->release_ = 0;
00540     }
00541   }
00542   return result;
00543 }

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

Definition at line 460 of file Policy_ForwardC.i.

References TAO_Base_Sequence::operator=.

00462 {
00463   if (this == &rhs)
00464     return *this;
00465   
00466   if (this->release_)
00467   {
00468     if (this->maximum_ < rhs.maximum_)
00469     {
00470       // free the old buffer
00471       CORBA::ULong *tmp = ACE_reinterpret_cast (CORBA::ULong *, this->buffer_);
00472       _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::freebuf (tmp);
00473       this->buffer_ = _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (rhs.maximum_);
00474     }
00475   }
00476   else
00477     this->buffer_ = _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::allocbuf (rhs.maximum_);
00478   
00479   TAO_Unbounded_Base_Sequence::operator= (rhs);
00480   
00481   CORBA::ULong *tmp1 = ACE_reinterpret_cast (CORBA::ULong *, this->buffer_);
00482   CORBA::ULong * const tmp2 = ACE_reinterpret_cast (CORBA::ULong * ACE_CAST_CONST, rhs.buffer_);
00483   
00484   for (CORBA::ULong i = 0; i < this->length_; ++i)
00485     tmp1[i] = tmp2[i];
00486   
00487   return *this;
00488 }

ACE_INLINE const CORBA::ULong & CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::operator[] CORBA::ULong    i const
 

Definition at line 501 of file Policy_ForwardC.i.

References ACE_ASSERT.

00503 {
00504   ACE_ASSERT (i < this->maximum_);
00505   CORBA::ULong * const tmp = ACE_reinterpret_cast (CORBA::ULong* ACE_CAST_CONST, this->buffer_);
00506   return tmp[i];
00507 }

ACE_INLINE CORBA::ULong & CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::operator[] CORBA::ULong    i
 

Definition at line 492 of file Policy_ForwardC.i.

References ACE_ASSERT.

00494 {
00495   ACE_ASSERT (i < this->maximum_);
00496   CORBA::ULong* tmp = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00497   return tmp[i];
00498 }

ACE_INLINE void CORBA::_TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::replace CORBA::ULong    max,
CORBA::ULong    length,
CORBA::ULong   data,
CORBA::Boolean    release
 

Definition at line 552 of file Policy_ForwardC.i.

References TAO_Base_Sequence::buffer_, TAO_Unbounded_Base_Sequence::length, TAO_Base_Sequence::length_, TAO_Base_Sequence::maximum_, TAO_Base_Sequence::release, and TAO_Base_Sequence::release_.

00556 {
00557   this->maximum_ = max;
00558   this->length_ = length;
00559   if (this->buffer_ && this->release_ == 1)
00560   {
00561     CORBA::ULong *tmp = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00562     _TAO_Unbounded_Sequence_CORBA_PolicyTypeSeq::freebuf (tmp);
00563   }
00564   this->buffer_ = data;
00565   this->release_ = release;
00566 }


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