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

CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort Class Reference

#include <PolicyC.h>

Inheritance diagram for CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort:

Inheritance graph
[legend]
Collaboration diagram for CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort:

Collaboration graph
[legend]
List of all members.

Public Methods

 _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort (void)
 _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort (CORBA::ULong maximum)
 _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort (CORBA::ULong maximum, CORBA::ULong length, CORBA::UShort *data, CORBA::Boolean release=0)
 _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort (const _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort &rhs)
_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort & operator= (const _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort &rhs)
virtual ~_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort (void)
CORBA::UShortoperator[] (CORBA::ULong i)
const CORBA::UShortoperator[] (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::UShortget_buffer (CORBA::Boolean orphan=0)
const CORBA::UShortget_buffer (void) const
void replace (CORBA::ULong max, CORBA::ULong length, CORBA::UShort *data, CORBA::Boolean release)

Static Public Methods

CORBA::UShortallocbuf (CORBA::ULong size)
void freebuf (CORBA::UShort *buffer)

Constructor & Destructor Documentation

ACE_INLINE CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort void   
 

Definition at line 53 of file PolicyC.i.

00054 {
00055 }

ACE_INLINE CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort CORBA::ULong    maximum
 

Definition at line 58 of file PolicyC.i.

00059   : TAO_Unbounded_Base_Sequence (maximum, _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf (maximum))
00060 {
00061 }

ACE_INLINE CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort CORBA::ULong    maximum,
CORBA::ULong    length,
CORBA::UShort   data,
CORBA::Boolean    release = 0
 

Definition at line 64 of file PolicyC.i.

00068 : TAO_Unbounded_Base_Sequence (maximum, length, data, release)
00069 {
00070 }

ACE_INLINE CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort const _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort &    rhs
 

Definition at line 73 of file PolicyC.i.

00075   : TAO_Unbounded_Base_Sequence (rhs)
00076 {
00077   if (rhs.buffer_ != 0)
00078   {
00079     CORBA::UShort *tmp1 = _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf (this->maximum_);
00080     CORBA::UShort * const tmp2 = ACE_reinterpret_cast (CORBA::UShort * ACE_CAST_CONST, rhs.buffer_);
00081     
00082     for (CORBA::ULong i = 0; i < this->length_; ++i)
00083       tmp1[i] = tmp2[i];
00084     
00085     this->buffer_ = tmp1;
00086   }
00087   else
00088   {
00089     this->buffer_ = 0;
00090   }
00091 }

CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::~_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort void    [virtual]
 

Definition at line 311 of file PolicyC.cpp.

00312 {
00313   this->_deallocate_buffer ();
00314 }


Member Function Documentation

void CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_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 280 of file PolicyC.cpp.

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

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

void CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::_deallocate_buffer void    [virtual]
 

Must deallocate the buffer and then set it to zero.

Implements TAO_Base_Sequence.

Definition at line 300 of file PolicyC.cpp.

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

00301 {
00302   if (this->buffer_ == 0 || this->release_ == 0)
00303     return;
00304   
00305   CORBA::UShort *tmp = ACE_reinterpret_cast (CORBA::UShort *,this->buffer_);
00306   
00307   _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::freebuf (tmp);
00308   this->buffer_ = 0;
00309 } 

ACE_INLINE CORBA::UShort * CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf CORBA::ULong    size [static]
 

Definition at line 38 of file PolicyC.i.

References ACE_NEW_RETURN.

00040 {
00041   CORBA::UShort *retval = 0;
00042   ACE_NEW_RETURN (retval, CORBA::UShort[size], 0);
00043   return retval;
00044 }

ACE_INLINE void CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::freebuf CORBA::UShort   buffer [static]
 

Definition at line 46 of file PolicyC.i.

References ACE_INLINE.

00048 {
00049   delete [] buffer;
00050 }

ACE_INLINE const CORBA::UShort * CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::get_buffer void    const
 

Definition at line 180 of file PolicyC.i.

00181 {
00182   return ACE_reinterpret_cast(const CORBA::UShort * ACE_CAST_CONST, this->buffer_);
00183 }

ACE_INLINE CORBA::UShort * CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::get_buffer CORBA::Boolean    orphan = 0
 

Definition at line 146 of file PolicyC.i.

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

Referenced by operator<<, and operator>>.

00147 {
00148   CORBA::UShort *result = 0;
00149   if (orphan == 0)
00150   {
00151     // We retain ownership.
00152     if (this->buffer_ == 0)
00153     {
00154       result = _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf (this->length_);
00155       this->buffer_ = result;
00156       this->release_ = 1;
00157     }
00158     else
00159     {
00160       result = ACE_reinterpret_cast (CORBA::UShort*, this->buffer_);
00161     }
00162   }
00163   else // if (orphan == 1)
00164   {
00165     if (this->release_ != 0)
00166     {
00167       // We set the state back to default and relinquish
00168       // ownership.
00169       result = ACE_reinterpret_cast(CORBA::UShort*,this->buffer_);
00170       this->maximum_ = 0;
00171       this->length_ = 0;
00172       this->buffer_ = 0;
00173       this->release_ = 0;
00174     }
00175   }
00176   return result;
00177 }

ACE_INLINE CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort & CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::operator= const _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort &    rhs
 

Definition at line 94 of file PolicyC.i.

References TAO_Base_Sequence::operator=.

00096 {
00097   if (this == &rhs)
00098     return *this;
00099   
00100   if (this->release_)
00101   {
00102     if (this->maximum_ < rhs.maximum_)
00103     {
00104       // free the old buffer
00105       CORBA::UShort *tmp = ACE_reinterpret_cast (CORBA::UShort *, this->buffer_);
00106       _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::freebuf (tmp);
00107       this->buffer_ = _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf (rhs.maximum_);
00108     }
00109   }
00110   else
00111     this->buffer_ = _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::allocbuf (rhs.maximum_);
00112   
00113   TAO_Unbounded_Base_Sequence::operator= (rhs);
00114   
00115   CORBA::UShort *tmp1 = ACE_reinterpret_cast (CORBA::UShort *, this->buffer_);
00116   CORBA::UShort * const tmp2 = ACE_reinterpret_cast (CORBA::UShort * ACE_CAST_CONST, rhs.buffer_);
00117   
00118   for (CORBA::ULong i = 0; i < this->length_; ++i)
00119     tmp1[i] = tmp2[i];
00120   
00121   return *this;
00122 }

ACE_INLINE const CORBA::UShort & CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::operator[] CORBA::ULong    i const
 

Definition at line 135 of file PolicyC.i.

References ACE_ASSERT.

00137 {
00138   ACE_ASSERT (i < this->maximum_);
00139   CORBA::UShort * const tmp = ACE_reinterpret_cast (CORBA::UShort* ACE_CAST_CONST, this->buffer_);
00140   return tmp[i];
00141 }

ACE_INLINE CORBA::UShort & CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::operator[] CORBA::ULong    i
 

Definition at line 126 of file PolicyC.i.

References ACE_ASSERT.

00128 {
00129   ACE_ASSERT (i < this->maximum_);
00130   CORBA::UShort* tmp = ACE_reinterpret_cast(CORBA::UShort*,this->buffer_);
00131   return tmp[i];
00132 }

ACE_INLINE void CORBA::InvalidPolicies::_TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::replace CORBA::ULong    max,
CORBA::ULong    length,
CORBA::UShort   data,
CORBA::Boolean    release
 

Definition at line 186 of file PolicyC.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_.

00190 {
00191   this->maximum_ = max;
00192   this->length_ = length;
00193   if (this->buffer_ && this->release_ == 1)
00194   {
00195     CORBA::UShort *tmp = ACE_reinterpret_cast(CORBA::UShort*,this->buffer_);
00196     _TAO_Unbounded_Sequence_CORBA_InvalidPolicies__tao_seq_UShort::freebuf (tmp);
00197   }
00198   this->buffer_ = data;
00199   this->release_ = release;
00200 }


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