TAO  2.4.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS > Class Template Reference

#include <Generic_Sequence_T.h>

Public Types

typedef T value_type
 
typedef ALLOCATION_TRAITS allocation_traits
 
typedef ELEMENT_TRAITS element_traits
 
typedef range_checking< value_type, true > range
 

Public Member Functions

 generic_sequence (void)
 Default constructor. More...
 
 generic_sequence (CORBA::ULong maximum)
 Constructor with control of ownership. More...
 
 generic_sequence (CORBA::ULong maximum, CORBA::ULong length, value_type *data, CORBA::Boolean release)
 
 generic_sequence (generic_sequence const &rhs)
 Copy constructor. More...
 
generic_sequenceoperator= (generic_sequence const &rhs)
 Assignment operator. More...
 
 ~generic_sequence ()
 Destructor. More...
 
CORBA::ULong maximum () const
 Return the maximum length of the sequence. More...
 
CORBA::Boolean release () const
 Returns the state of the sequence release flag. More...
 
CORBA::ULong length () const
 Returns the length of the sequence. More...
 
void length (CORBA::ULong length)
 Set a new length for the sequence. More...
 
value_type const & operator[] (CORBA::ULong i) const
 Get a const element from the sequence. More...
 
value_typeoperator[] (CORBA::ULong i)
 Get an element from the sequence. More...
 
void replace (CORBA::ULong maximum, CORBA::ULong length, value_type *data, CORBA::Boolean release)
 
value_type const * get_buffer () const
 
value_typeget_buffer (CORBA::Boolean orphan)
 Allows read-write access to the underlying buffer. More...
 
void swap (generic_sequence &rhs) throw ()
 

Static Public Member Functions

static value_typeallocbuf (CORBA::ULong maximum)
 
static void freebuf (value_type *buffer)
 

Private Attributes

CORBA::ULong maximum_
 The maximum number of elements the buffer can contain. More...
 
CORBA::ULong length_
 The current number of elements in the buffer. More...
 
value_typebuffer_
 The buffer with all the elements. More...
 
CORBA::Boolean release_
 

Member Typedef Documentation

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
typedef ALLOCATION_TRAITS TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::allocation_traits
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
typedef ELEMENT_TRAITS TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::element_traits
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
typedef range_checking<value_type,true> TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::range
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
typedef T TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::value_type

Constructor & Destructor Documentation

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::generic_sequence ( void  )
inline

Default constructor.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::generic_sequence ( CORBA::ULong  maximum)
inlineexplicit

Constructor with control of ownership.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::generic_sequence ( CORBA::ULong  maximum,
CORBA::ULong  length,
value_type data,
CORBA::Boolean  release 
)
inline
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::generic_sequence ( generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS > const &  rhs)
inline

Copy constructor.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::~generic_sequence ( )
inline

Destructor.

Member Function Documentation

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
static value_type* TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::allocbuf ( CORBA::ULong  maximum)
inlinestatic
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
static void TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::freebuf ( value_type buffer)
inlinestatic
template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
value_type const* TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::get_buffer ( ) const
inline

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, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
value_type* TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::get_buffer ( CORBA::Boolean  orphan)
inline

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. 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 strings, 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<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::ULong TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::length ( void  ) const
inline

Returns the length of the sequence.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
void TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::length ( CORBA::ULong  length)
inline

Set a new length for the sequence.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::ULong TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::maximum ( ) const
inline

Return the maximum length of the sequence.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
generic_sequence& TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::operator= ( generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS > const &  rhs)
inline

Assignment operator.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
value_type const& TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::operator[] ( CORBA::ULong  i) const
inline

Get a const element from the sequence.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
value_type& TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::operator[] ( CORBA::ULong  i)
inline

Get an element from the sequence.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::Boolean TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::release ( ) const
inline

Returns the state of the sequence release flag.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
void TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::replace ( CORBA::ULong  maximum,
CORBA::ULong  length,
value_type data,
CORBA::Boolean  release 
)
inline

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.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
void TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::swap ( generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS > &  rhs)
throw (
)
inline

Member Data Documentation

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
value_type* TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::buffer_
mutableprivate

The buffer with all the elements.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::ULong TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::length_
private

The current number of elements in the buffer.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::ULong TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::maximum_
private

The maximum number of elements the buffer can contain.

template<typename T, class ALLOCATION_TRAITS, class ELEMENT_TRAITS>
CORBA::Boolean TAO::details::generic_sequence< T, ALLOCATION_TRAITS, ELEMENT_TRAITS >::release_
mutableprivate

If true then the sequence should release the buffer when it is destroyed.


The documentation for this class was generated from the following file: