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

TAO_Bounded_Sequence Class Template Reference

Parametric bounded sequence. More...

#include <Sequence_T.h>

Inheritance diagram for TAO_Bounded_Sequence

Inheritance graph
[legend]
Collaboration diagram for TAO_Bounded_Sequence:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Bounded_Sequence (void)
 Default constructor.

 TAO_Bounded_Sequence (CORBA::ULong length, T *data, CORBA::Boolean release=0)
 Constructor using the data and memory management flag.

 TAO_Bounded_Sequence (const TAO_Bounded_Sequence<T,MAX> &)
 Copy constructor.

TAO_Bounded_Sequence<T,MAX>& operator= (const TAO_Bounded_Sequence<T,MAX> &)
 Assignment operator.

 ~TAO_Bounded_Sequence (void)
 Dtor.

T& operator[] (CORBA::ULong)
 operator [].

const T& operator[] (CORBA::ULong) const
 operator [].

virtual void _allocate_buffer (CORBA::ULong length)
 allocate a buffer of the requested length. The buffer is allocated for the right type.

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 Methods

T* allocbuf (CORBA::ULong)
 Allocate storage for the sequence.

void freebuf (T *)
 Free the sequence.


Detailed Description

template<class T, size_t MAX> template class TAO_Bounded_Sequence

Parametric bounded sequence.

This class completes the implementation for TAO_Base_Sequence for the bounded case.


Constructor & Destructor Documentation

template<classT, size_tMAX>
ACE_INLINE TAO_Bounded_Sequence< T,MAX >::TAO_Bounded_Sequence<T, MAX> ( void )
 

Default constructor.

template<classT, size_tMAX>
ACE_INLINE TAO_Bounded_Sequence< T,MAX >::TAO_Bounded_Sequence<T, MAX> ( CORBA::ULong length,
T * data,
CORBA::Boolean release = 0 )
 

Constructor using the data and memory management flag.

template<classT, size_tMAX>
TAO_Bounded_Sequence<T, MAX>::TAO_Bounded_Sequence<T, MAX> ( const TAO_Bounded_Sequence< T,MAX >& rhs )
 

Copy constructor.

template<classT, size_tMAX>
TAO_Bounded_Sequence<T, MAX>::~TAO_Bounded_Sequence<T, MAX> ( void )
 

Dtor.


Member Function Documentation

template<classT, size_tMAX>
void TAO_Bounded_Sequence<T, MAX>::_allocate_buffer ( CORBA::ULong length ) [virtual]
 

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

Reimplemented from TAO_Base_Sequence.

template<classT, size_tMAX>
void TAO_Bounded_Sequence<T, MAX>::_deallocate_buffer ( void ) [virtual]
 

deallocate the buffer.

Reimplemented from TAO_Base_Sequence.

template<classT, size_tMAX>
ACE_INLINE T * TAO_Bounded_Sequence< T,MAX >::allocbuf ( CORBA::ULong ) [static]
 

Allocate storage for the sequence.

template<classT, size_tMAX>
ACE_INLINE void TAO_Bounded_Sequence< T,MAX >::freebuf ( T * buffer ) [static]
 

Free the sequence.

template<classT, size_tMAX>
ACE_INLINE const T * TAO_Bounded_Sequence< T,MAX >::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<classT, size_tMAX>
ACE_INLINE T * TAO_Bounded_Sequence< T,MAX >::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 size of the returned buffer is equal to the sequence bound, which can be determined with the <maximum> accessor. 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. For sequences of strings, wide strings, and object references, the caller must use the sequence <release> accessor to determine whether elements should be freed (using <string_free>, <wstring_free>, or <CORBA::release> for strings, wide straings, and object references, respective) before being directly assigned to.

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<classT, size_tMAX>
TAO_Bounded_Sequence< T,MAX >& TAO_Bounded_Sequence<T, MAX>::operator= ( const TAO_Bounded_Sequence< T,MAX >& rhs )
 

Assignment operator.

template<classT, size_tMAX>
ACE_INLINE const T & TAO_Bounded_Sequence< T,MAX >::operator[] ( CORBA::ULong i ) const
 

operator [].

template<classT, size_tMAX>
ACE_INLINE T & TAO_Bounded_Sequence< T,MAX >::operator[] ( CORBA::ULong i )
 

operator [].

template<classT, size_tMAX>
ACE_INLINE void TAO_Bounded_Sequence< T,MAX >::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 at Sat Dec 1 12:06:25 2001 for TAO by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000