TAO::bounded_value_sequence< T, MAX > Class Template Reference

#include <Bounded_Value_Sequence_T.h>

List of all members.

Public Types

typedef T value_type
typedef T element_type
typedef T const const_value_type
typedef value_type & subscript_type
typedef value_type const & const_subscript_type
typedef details::bounded_value_allocation_traits<
value_type, MAX, true > 
allocation_traits
typedef details::value_traits<
value_type, true > 
element_traits
typedef details::generic_sequence<
value_type, allocation_traits,
element_traits > 
implementation_type

Public Member Functions

 bounded_value_sequence ()
 bounded_value_sequence (CORBA::ULong length, value_type *data, CORBA::Boolean release=false)
CORBA::ULong maximum () const
 Return the maximum length of the sequence.
CORBA::Boolean release () const
 Returns the state of the sequence release flag.
CORBA::ULong length () const
 Returns the length of the sequence.
void length (CORBA::ULong length)
 Returns the length of the sequence.
value_type const & operator[] (CORBA::ULong i) const
 Get a const element from the sequence.
value_type & operator[] (CORBA::ULong i)
 Get a const element from the sequence.
void replace (CORBA::ULong length, value_type *data, CORBA::Boolean release=false)
 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.
value_type const * get_buffer () 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.
value_type * get_buffer (CORBA::Boolean orphan=false)
 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().

void swap (bounded_value_sequence &rhs) throw ()
 

Static Public Member Functions

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

Private Attributes

implementation_type impl_


Detailed Description

template<class T, CORBA::ULong MAX>
class TAO::bounded_value_sequence< T, MAX >

Definition at line 24 of file Bounded_Value_Sequence_T.h.


Member Typedef Documentation

template<class T, CORBA::ULong MAX>
typedef details::bounded_value_allocation_traits<value_type,MAX,true> TAO::bounded_value_sequence< T, MAX >::allocation_traits

Definition at line 33 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef value_type const& TAO::bounded_value_sequence< T, MAX >::const_subscript_type

Definition at line 31 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef T const TAO::bounded_value_sequence< T, MAX >::const_value_type

Definition at line 29 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef details::value_traits<value_type,true> TAO::bounded_value_sequence< T, MAX >::element_traits

Definition at line 34 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef T TAO::bounded_value_sequence< T, MAX >::element_type

Definition at line 28 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef details::generic_sequence<value_type, allocation_traits, element_traits> TAO::bounded_value_sequence< T, MAX >::implementation_type

Definition at line 35 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef value_type& TAO::bounded_value_sequence< T, MAX >::subscript_type

Definition at line 30 of file Bounded_Value_Sequence_T.h.

template<class T, CORBA::ULong MAX>
typedef T TAO::bounded_value_sequence< T, MAX >::value_type

Definition at line 27 of file Bounded_Value_Sequence_T.h.


Constructor & Destructor Documentation

template<class T, CORBA::ULong MAX>
TAO::bounded_value_sequence< T, MAX >::bounded_value_sequence (  )  [inline]

Definition at line 37 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_.

00038     : impl_()
00039   {}

template<class T, CORBA::ULong MAX>
TAO::bounded_value_sequence< T, MAX >::bounded_value_sequence ( CORBA::ULong  length,
value_type *  data,
CORBA::Boolean  release = false 
) [inline]

Definition at line 40 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_.

00044     : impl_(MAX, length, data, release)
00045   {}


Member Function Documentation

template<class T, CORBA::ULong MAX>
static value_type* TAO::bounded_value_sequence< T, MAX >::allocbuf (  )  [inline, static]

Definition at line 95 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::allocbuf().

00095                                  {
00096     return implementation_type::allocbuf(MAX);
00097   }

template<class T, CORBA::ULong MAX>
static value_type* TAO::bounded_value_sequence< T, MAX >::allocbuf ( CORBA::ULong  maximum  )  [inline, static]

Definition at line 92 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::allocbuf().

Referenced by TAO::bounded_value_sequence< T, MAX >::allocbuf().

00092                                                    {
00093     return implementation_type::allocbuf(maximum);
00094   }

template<class T, CORBA::ULong MAX>
static void TAO::bounded_value_sequence< T, MAX >::freebuf ( value_type *  buffer  )  [inline, static]

Definition at line 98 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::freebuf().

Referenced by TAO::bounded_value_sequence< T, MAX >::freebuf().

00099   {
00100     implementation_type::freebuf(buffer);
00101   }

template<class T, CORBA::ULong MAX>
value_type* TAO::bounded_value_sequence< T, MAX >::get_buffer ( CORBA::Boolean  orphan = false  )  [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().

Definition at line 85 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::get_buffer(), and TAO::bounded_value_sequence< T, MAX >::impl_.

00085                                                               {
00086     return impl_.get_buffer(orphan);
00087   }

template<class T, CORBA::ULong MAX>
value_type const* TAO::bounded_value_sequence< T, MAX >::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.

Definition at line 81 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::get_buffer(), and TAO::bounded_value_sequence< T, MAX >::impl_.

Referenced by TAO::bounded_value_sequence< T, MAX >::get_buffer().

00081                                                {
00082     return impl_.get_buffer();
00083   }

template<class T, CORBA::ULong MAX>
void TAO::bounded_value_sequence< T, MAX >::length ( CORBA::ULong  length  )  [inline]

Returns the length of the sequence.

Definition at line 61 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::length().

00061                                         {
00062     implementation_type::range::check_length(length, MAX);
00063     impl_.length(length);
00064   }

template<class T, CORBA::ULong MAX>
CORBA::ULong TAO::bounded_value_sequence< T, MAX >::length ( void   )  const [inline]

Returns the length of the sequence.

Definition at line 57 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::length().

Referenced by TAO::bounded_value_sequence< T, MAX >::length().

00057                                    {
00058     return impl_.length();
00059   }

template<class T, CORBA::ULong MAX>
CORBA::ULong TAO::bounded_value_sequence< T, MAX >::maximum (  )  const [inline]

Return the maximum length of the sequence.

Definition at line 49 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::maximum().

Referenced by TAO::bounded_value_sequence< T, MAX >::maximum().

00049                                     {
00050     return impl_.maximum();
00051   }

template<class T, CORBA::ULong MAX>
value_type& TAO::bounded_value_sequence< T, MAX >::operator[] ( CORBA::ULong  i  )  [inline]

Get a const element from the sequence.

Definition at line 70 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::operator[]().

00070                                                {
00071     return impl_[i];
00072   }

template<class T, CORBA::ULong MAX>
value_type const& TAO::bounded_value_sequence< T, MAX >::operator[] ( CORBA::ULong  i  )  const [inline]

Get a const element from the sequence.

Definition at line 66 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::operator[]().

Referenced by TAO::bounded_value_sequence< T, MAX >::operator[]().

00066                                                            {
00067     return impl_[i];
00068   }

template<class T, CORBA::ULong MAX>
CORBA::Boolean TAO::bounded_value_sequence< T, MAX >::release ( void   )  const [inline]

Returns the state of the sequence release flag.

Definition at line 53 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_.

00053                                       {
00054     return impl_.release();
00055   }

template<class T, CORBA::ULong MAX>
void TAO::bounded_value_sequence< T, MAX >::replace ( CORBA::ULong  length,
value_type *  data,
CORBA::Boolean  release = false 
) [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.

Definition at line 74 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, CORBA::release(), and TAO::bounded_value_sequence< T, MAX >::replace().

Referenced by TAO::bounded_value_sequence< T, MAX >::replace().

00077                                     {
00078     impl_.replace(MAX, length, data, release);
00079   }

template<class T, CORBA::ULong MAX>
void TAO::bounded_value_sequence< T, MAX >::swap ( bounded_value_sequence< T, MAX > &  rhs  )  throw () [inline]

Definition at line 89 of file Bounded_Value_Sequence_T.h.

References TAO::bounded_value_sequence< T, MAX >::impl_, and TAO::bounded_value_sequence< T, MAX >::swap().

Referenced by TAO::bounded_value_sequence< T, MAX >::swap().

00089                                                          {
00090     impl_.swap(rhs.impl_);
00091   }


Member Data Documentation

template<class T, CORBA::ULong MAX>
implementation_type TAO::bounded_value_sequence< T, MAX >::impl_ [private]

Definition at line 104 of file Bounded_Value_Sequence_T.h.

Referenced by TAO::bounded_value_sequence< T, MAX >::bounded_value_sequence(), TAO::bounded_value_sequence< T, MAX >::get_buffer(), TAO::bounded_value_sequence< T, MAX >::length(), TAO::bounded_value_sequence< T, MAX >::maximum(), TAO::bounded_value_sequence< T, MAX >::operator[](), TAO::bounded_value_sequence< T, MAX >::release(), TAO::bounded_value_sequence< T, MAX >::replace(), and TAO::bounded_value_sequence< T, MAX >::swap().


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 17:39:09 2010 for TAO by  doxygen 1.4.7