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

CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId Class Reference

#include <CONV_FRAMEC.h>

Inheritance diagram for CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId:

Inheritance graph
[legend]
Collaboration diagram for CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId:

Collaboration graph
[legend]
List of all members.

Public Methods

 _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId (void)
 _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId (CORBA::ULong maximum)
 _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId (CORBA::ULong maximum, CORBA::ULong length, CORBA::ULong *data, CORBA::Boolean release=0)
 _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId (const _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId &rhs)
_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId & operator= (const _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId &rhs)
virtual ~_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId (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 CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId void   
 

Definition at line 212 of file CONV_FRAMEC.i.

00213   {
00214   }

ACE_INLINE CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId CORBA::ULong    maximum
 

Definition at line 217 of file CONV_FRAMEC.i.

References allocbuf.

ACE_INLINE CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId CORBA::ULong    maximum,
CORBA::ULong    length,
CORBA::ULong   data,
CORBA::Boolean    release = 0
 

Definition at line 223 of file CONV_FRAMEC.i.

00227   : TAO_Unbounded_Base_Sequence (maximum, length, data, release)
00228   {
00229   }

ACE_INLINE CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId const _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId &    rhs
 

Definition at line 232 of file CONV_FRAMEC.i.

References allocbuf.

00234     : TAO_Unbounded_Base_Sequence (rhs)
00235   {
00236     CORBA::ULong *tmp1 = CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf (this->maximum_);
00237     CORBA::ULong * const tmp2 = ACE_reinterpret_cast (CORBA::ULong * ACE_CAST_CONST, rhs.buffer_);
00238 
00239     for (CORBA::ULong i = 0; i < this->length_; ++i)
00240       tmp1[i] = tmp2[i];
00241 
00242     this->buffer_ = tmp1;
00243   }

CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::~_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId void    [virtual]
 

Definition at line 135 of file CONV_FRAMEC.cpp.

00136   {
00137     this->_deallocate_buffer ();
00138   }


Member Function Documentation

void CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_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 105 of file CONV_FRAMEC.cpp.

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

00106   {
00107     CORBA::ULong* tmp = CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf (length);
00108 
00109     if (this->buffer_ != 0)
00110     {
00111       CORBA::ULong *old = ACE_reinterpret_cast (CORBA::ULong *,this->buffer_);
00112 
00113       for (CORBA::ULong i = 0; i < this->length_; ++i)
00114         tmp[i] = old[i];
00115 
00116       if (this->release_)
00117         CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::freebuf (old);
00118 
00119     }
00120     this->buffer_ = tmp;
00121   }

void CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::_deallocate_buffer void    [virtual]
 

Must deallocate the buffer and then set it to zero.

Implements TAO_Base_Sequence.

Definition at line 124 of file CONV_FRAMEC.cpp.

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

00125   {
00126     if (this->buffer_ == 0 || this->release_ == 0)
00127       return;
00128 
00129     CORBA::ULong *tmp = ACE_reinterpret_cast (CORBA::ULong *,this->buffer_);
00130 
00131     CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::freebuf (tmp);
00132     this->buffer_ = 0;
00133   }

ACE_INLINE CORBA::ULong * CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf CORBA::ULong    size [static]
 

Definition at line 197 of file CONV_FRAMEC.i.

References ACE_NEW_RETURN.

Referenced by _allocate_buffer, _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId, get_buffer, and operator=.

00199   {
00200     CORBA::ULong *retval = 0;
00201     ACE_NEW_RETURN (retval, CORBA::ULong[size], 0);
00202     return retval;
00203   }

ACE_INLINE void CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::freebuf CORBA::ULong   buffer [static]
 

Definition at line 205 of file CONV_FRAMEC.i.

References ACE_INLINE.

Referenced by _allocate_buffer, _deallocate_buffer, operator=, and replace.

00207   {
00208     delete [] buffer;
00209   }

ACE_INLINE const CORBA::ULong * CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::get_buffer void    const
 

Definition at line 332 of file CONV_FRAMEC.i.

00333   {
00334     return ACE_reinterpret_cast(const CORBA::ULong * ACE_CAST_CONST, this->buffer_);
00335   }

ACE_INLINE CORBA::ULong * CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::get_buffer CORBA::Boolean    orphan = 0
 

Definition at line 298 of file CONV_FRAMEC.i.

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

Referenced by operator<<, and operator>>.

00299   {
00300     CORBA::ULong *result = 0;
00301     if (orphan == 0)
00302     {
00303       // We retain ownership.
00304       if (this->buffer_ == 0)
00305       {
00306         result = CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf (this->length_);
00307         this->buffer_ = result;
00308         this->release_ = 1;
00309       }
00310       else
00311       {
00312         result = ACE_reinterpret_cast (CORBA::ULong*, this->buffer_);
00313       }
00314     }
00315     else // if (orphan == 1)
00316     {
00317       if (this->release_ != 0)
00318       {
00319         // We set the state back to default and relinquish
00320         // ownership.
00321         result = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00322         this->maximum_ = 0;
00323         this->length_ = 0;
00324         this->buffer_ = 0;
00325         this->release_ = 0;
00326       }
00327     }
00328     return result;
00329   }

ACE_INLINE CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId & CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::operator= const _TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId &    rhs
 

Definition at line 246 of file CONV_FRAMEC.i.

References allocbuf, freebuf, and TAO_Base_Sequence::operator=.

00248   {
00249     if (this == &rhs)
00250       return *this;
00251 
00252     if (this->release_)
00253     {
00254       if (this->maximum_ < rhs.maximum_)
00255       {
00256         // free the old buffer
00257         CORBA::ULong *tmp = ACE_reinterpret_cast (CORBA::ULong *, this->buffer_);
00258         CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::freebuf (tmp);
00259         this->buffer_ = CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf (rhs.maximum_);
00260       }
00261     }
00262     else
00263       this->buffer_ = CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::allocbuf (rhs.maximum_);
00264 
00265     TAO_Unbounded_Base_Sequence::operator= (rhs);
00266 
00267     CORBA::ULong *tmp1 = ACE_reinterpret_cast (CORBA::ULong *, this->buffer_);
00268     CORBA::ULong * const tmp2 = ACE_reinterpret_cast (CORBA::ULong * ACE_CAST_CONST, rhs.buffer_);
00269 
00270     for (CORBA::ULong i = 0; i < this->length_; ++i)
00271       tmp1[i] = tmp2[i];
00272 
00273     return *this;
00274   }

ACE_INLINE const CORBA::ULong & CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::operator[] CORBA::ULong    i const
 

Definition at line 287 of file CONV_FRAMEC.i.

References ACE_ASSERT.

00289   {
00290     ACE_ASSERT (i < this->maximum_);
00291     CORBA::ULong * const tmp = ACE_reinterpret_cast (CORBA::ULong* ACE_CAST_CONST, this->buffer_);
00292     return tmp[i];
00293   }

ACE_INLINE CORBA::ULong & CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::operator[] CORBA::ULong    i
 

Definition at line 278 of file CONV_FRAMEC.i.

References ACE_ASSERT.

00280   {
00281     ACE_ASSERT (i < this->maximum_);
00282     CORBA::ULong* tmp = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00283     return tmp[i];
00284   }

ACE_INLINE void CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::replace CORBA::ULong    max,
CORBA::ULong    length,
CORBA::ULong   data,
CORBA::Boolean    release
 

Definition at line 338 of file CONV_FRAMEC.i.

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

00342   {
00343     this->maximum_ = max;
00344     this->length_ = length;
00345     if (this->buffer_ && this->release_ == 1)
00346     {
00347       CORBA::ULong *tmp = ACE_reinterpret_cast(CORBA::ULong*,this->buffer_);
00348       CONV_FRAME::CodeSetComponent::_TAO_Unbounded_Sequence_CONV_FRAME_CodeSetComponent__tao_seq_CodeSetId::freebuf (tmp);
00349     }
00350     this->buffer_ = data;
00351     this->release_ = release;
00352   }


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