Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TAO_Unbounded_Array_Sequence< T, T_slice, TAG > Class Template Reference

Parametric sequence for arrays. More...

#include <Sequence_T.h>

Inheritance diagram for TAO_Unbounded_Array_Sequence< T, T_slice, TAG >:

Inheritance graph
[legend]
Collaboration diagram for TAO_Unbounded_Array_Sequence< T, T_slice, TAG >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Unbounded_Array_Sequence (void)
 default ctor
 TAO_Unbounded_Array_Sequence (CORBA::ULong max)
 Constructor with a "hint" for the maximum capacity.
 TAO_Unbounded_Array_Sequence (CORBA::ULong maximum, CORBA::ULong length, T *data, CORBA::Boolean release=0)
 Constructor with a given buffer.
 TAO_Unbounded_Array_Sequence (const TAO_Unbounded_Array_Sequence< T, T_slice, TAG > &)
 Copy ctor, deep copies.
 ~TAO_Unbounded_Array_Sequence (void)
 dtor releases all the contained elements.
TAO_Unbounded_Array_Sequence<
T, T_slice, TAG > & 
operator= (const TAO_Unbounded_Array_Sequence< T, T_slice, TAG > &)
T & operator[] (CORBA::ULong)
 operator []
const T & operator[] (CORBA::ULong) const
 operator []
virtual void _allocate_buffer (CORBA::ULong length)
virtual void _deallocate_buffer (void)
 deallocate the buffer
T * get_buffer (CORBA::Boolean orphan=0)
const T * get_buffer (void) const
void replace (CORBA::ULong max, CORBA::ULong length, T *data, CORBA::Boolean release=0)

Static Public Member Functions

T * allocbuf (CORBA::ULong)
void freebuf (T *)
 Release all the elements.

Detailed Description

template<typename T, typename T_slice, typename TAG>
class TAO_Unbounded_Array_Sequence< T, T_slice, TAG >

Parametric sequence for arrays.

The IDL mapping for arrays includes some unique allocation, deallocation, and copying functions, and precludes direct assignment of one array to another. Also, the Any and CDR operators use a special class derived from the array. For these reasons, we use a special class for sequences of arrays.


Constructor & Destructor Documentation

template<typename T, typename T_slice, typename TAG>
ACE_INLINE TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::TAO_Unbounded_Array_Sequence void   ) 
 

default ctor

template<typename T, typename T_slice, typename TAG>
ACE_INLINE TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::TAO_Unbounded_Array_Sequence CORBA::ULong  max  ) 
 

Constructor with a "hint" for the maximum capacity.

template<typename T, typename T_slice, typename TAG>
ACE_INLINE TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::TAO_Unbounded_Array_Sequence CORBA::ULong  maximum,
CORBA::ULong  length,
T *  data,
CORBA::Boolean  release = 0
 

Constructor with a given buffer.

template<typename T, typename T_slice, typename TAG>
TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::TAO_Unbounded_Array_Sequence const TAO_Unbounded_Array_Sequence< T, T_slice, TAG > &   ) 
 

Copy ctor, deep copies.

template<typename T, typename T_slice, typename TAG>
TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::~TAO_Unbounded_Array_Sequence void   ) 
 

dtor releases all the contained elements.


Member Function Documentation

template<typename T, typename T_slice, typename TAG>
void TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::_allocate_buffer CORBA::ULong  length  )  [virtual]
 

allocate a buffer of the requested length. The buffer is allocated for the right type

Implements TAO_Base_Sequence.

template<typename T, typename T_slice, typename TAG>
void TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::_deallocate_buffer void   )  [virtual]
 

deallocate the buffer

Implements TAO_Base_Sequence.

template<typename T, typename T_slice, typename TAG>
T * TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::allocbuf CORBA::ULong   )  [static]
 

The allocbuf function allocates a vector of T elements that can be passed to the T *data constructor.

template<typename T, typename T_slice, typename TAG>
ACE_INLINE void TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::freebuf T *   )  [static]
 

Release all the elements.

template<typename T, typename T_slice, typename TAG>
ACE_INLINE const T * TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::get_buffer void   )  const
 

This function allows read-only access to the sequence buffer. The sequence returns its buffer, allocating one of one has not yet been allocated. No direct modification of the returned buffer by the caller is permitted.

template<typename T, typename T_slice, typename TAG>
T * TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::get_buffer CORBA::Boolean  orphan = 0  ) 
 

Allows read-write access to the underlying buffer. If <orphan> is FALSE the sequence returns a pointer to its buffer, allocating one if it has not yet done so. The number of elements in the buffer can be determined from the sequence <length> accessor.

If the <orphan> argument to <get_buffer> is FALSE, the sequence maintains ownership of the underlying buffer. Elements in the returned buffer may be directly replaced by the caller.

If the <orphan> argument to <get_buffer> is TRUE, the sequence yields ownership of the buffer to the caller. If <orphan> is TRUE and the sequence does not own its buffer (i.e., its <release> flag is FALSE), the return value is a null pointer. If the buffer is taken from the sequence using this form of <get_buffer>, the sequence reverts to the same state it would have if constructed using its default constructor. The caller becomes responsible for eventually freeing each element of the returned buffer (for strings, wide string, and object references), and then freeing the returned buffer itself using <freebuf>.

template<typename T, typename T_slice, typename TAG>
TAO_Unbounded_Array_Sequence< T, T_slice, TAG > & TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::operator= const TAO_Unbounded_Array_Sequence< T, T_slice, TAG > &   ) 
 

The assignment operator first releases all object reference members and frees all string members, and then performs a deepcopy to create a new structure.

template<typename T, typename T_slice, typename TAG>
ACE_INLINE const T & TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::operator[] CORBA::ULong   )  const
 

operator []

template<typename T, typename T_slice, typename TAG>
ACE_INLINE T & TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::operator[] CORBA::ULong   ) 
 

operator []

template<typename T, typename T_slice, typename TAG>
void TAO_Unbounded_Array_Sequence< T, T_slice, TAG >::replace CORBA::ULong  max,
CORBA::ULong  length,
T *  data,
CORBA::Boolean  release = 0
 

Allows the buffer underlying a sequence to be replaced. The parameters to <replace> are identical in type, order, and purpose to those for the <T *data> constructor for the sequence.


The documentation for this class was generated from the following files:
Generated on Fri Dec 31 15:33:18 2004 for TAO by  doxygen 1.3.9.1