ACE_Array_Base< T > Class Template ReferenceImplement a simple dynamic array. More...
Inheritance diagram for ACE_Array_Base< T >:
Collaboration diagram for ACE_Array_Base< T >:
Detailed Descriptiontemplate<class T>
Implement a simple dynamic array.
|
typedef T ACE_Array_Base< T >::TYPE |
Reimplemented in ACE_Array< T >, ACE_Array< ACE_Get_Opt::ACE_Get_Opt_Long_Option * >, and ACE_Array< ACE_INET_Addr >.
typedef ACE_Array_Iterator<T> ACE_Array_Base< T >::ITERATOR |
Reimplemented in ACE_Array< T >, ACE_Array< ACE_Get_Opt::ACE_Get_Opt_Long_Option * >, and ACE_Array< ACE_INET_Addr >.
typedef T ACE_Array_Base< T >::value_type |
typedef value_type* ACE_Array_Base< T >::iterator |
typedef value_type const* ACE_Array_Base< T >::const_iterator |
typedef value_type& ACE_Array_Base< T >::reference |
typedef value_type const& ACE_Array_Base< T >::const_reference |
typedef value_type* ACE_Array_Base< T >::pointer |
typedef value_type const* ACE_Array_Base< T >::const_pointer |
typedef ptrdiff_t ACE_Array_Base< T >::difference_type |
typedef ACE_Allocator::size_type ACE_Array_Base< T >::size_type |
ACE_DECLARE_STL_REVERSE_ITERATORS ACE_Array_Base< T >::ACE_Array_Base | ( | size_type | size = 0 , |
|
ACE_Allocator * | the_allocator = 0 | |||
) |
Dynamically create an uninitialized array.
ACE_Array_Base< T >::ACE_Array_Base | ( | size_type | size, | |
T const & | default_value, | |||
ACE_Allocator * | the_allocator = 0 | |||
) |
Dynamically initialize the entire array to the <default_value>.
ACE_Array_Base< T >::ACE_Array_Base | ( | ACE_Array_Base< T > const & | s | ) | [inline] |
The copy constructor performs initialization by making an exact copy of the contents of parameter <s>, i.e., *this == s will return true.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Array_Base< T >::~ACE_Array_Base | ( | void | ) | [inline] |
Clean up the array (e.g., delete dynamically allocated memory).
void ACE_Array_Base< T >::operator= | ( | ACE_Array_Base< T > const & | s | ) | [inline] |
Assignment operator performs an assignment by making an exact copy of the contents of parameter <s>, i.e., *this == s will return true. Note that if the <max_size_> of <array_> is >= than <s.max_size_> we can copy it without reallocating. However, if <max_size_> is < <s.max_size_> we must delete the <array_>, reallocate a new <array_>, and then copy the contents of <s>.
T& ACE_Array_Base< T >::operator[] | ( | size_type | slot | ) |
Set item in the array at location slot. Doesn't perform range checking.
T const& ACE_Array_Base< T >::operator[] | ( | size_type | slot | ) | const |
Get item in the array at location slot. Doesn't perform range checking.
int ACE_Array_Base< T >::set | ( | T const & | new_item, | |
size_type | slot | |||
) |
Set an item in the array at location slot. Returns -1 if slot is not in range, else returns 0.
int ACE_Array_Base< T >::get | ( | T & | item, | |
size_type | slot | |||
) | const |
Get an item in the array at location slot. Returns -1 if slot is not in range, else returns 0. Note that this function copies the item. If you want to avoid the copy, you can use the const operator [], but then you'll be responsible for range checking.
ACE_INLINE ACE_Array_Base< T >::size_type ACE_Array_Base< T >::size | ( | void | ) | const [inline] |
int ACE_Array_Base< T >::size | ( | size_type | new_size | ) |
Changes the size of the array to match <new_size>. It copies the old contents into the new array. Return -1 on failure.
ACE_INLINE ACE_Array_Base< T >::size_type ACE_Array_Base< T >::max_size | ( | void | ) | const [inline] |
Returns the <max_size_> of the array.
int ACE_Array_Base< T >::max_size | ( | size_type | new_size | ) |
Changes the size of the array to match <new_size>. It copies the old contents into the new array. Return -1 on failure. It does not affect new_size
ACE_INLINE ACE_Array_Base< T >::iterator ACE_Array_Base< T >::begin | ( | void | ) | [inline] |
ACE_INLINE ACE_Array_Base< T >::iterator ACE_Array_Base< T >::end | ( | void | ) | [inline] |
ACE_INLINE ACE_Array_Base< T >::const_iterator ACE_Array_Base< T >::begin | ( | void | ) | const [inline] |
ACE_INLINE ACE_Array_Base< T >::const_iterator ACE_Array_Base< T >::end | ( | void | ) | const [inline] |
ACE_INLINE ACE_Array_Base< T >::reverse_iterator ACE_Array_Base< T >::rbegin | ( | void | ) | [inline] |
ACE_INLINE ACE_Array_Base< T >::reverse_iterator ACE_Array_Base< T >::rend | ( | void | ) | [inline] |
ACE_INLINE ACE_Array_Base< T >::const_reverse_iterator ACE_Array_Base< T >::rbegin | ( | void | ) | const [inline] |
ACE_INLINE ACE_Array_Base< T >::const_reverse_iterator ACE_Array_Base< T >::rend | ( | void | ) | const [inline] |
void ACE_Array_Base< T >::swap | ( | ACE_Array_Base< T > & | array | ) | [inline] |
Swap the contents of this array with the given array in an exception-safe manner.
bool ACE_Array_Base< T >::in_range | ( | size_type | slot | ) | const [protected] |
Returns 1 if slot is within range, i.e., 0 >= slot < <cur_size_>, else returns 0.
friend class ACE_Array_Iterator< T > [friend] |
size_type ACE_Array_Base< T >::max_size_ [protected] |
Maximum size of the array, i.e., the total number of <T> elements in <array_>.
size_type ACE_Array_Base< T >::cur_size_ [protected] |
Current size of the array. This starts out being == to <max_size_>. However, if we are assigned a smaller array, then <cur_size_> will become less than <max_size_>. The purpose of keeping track of both sizes is to avoid reallocating memory if we don't have to.
value_type* ACE_Array_Base< T >::array_ [protected] |
Pointer to the array's storage buffer.
ACE_Allocator* ACE_Array_Base< T >::allocator_ [protected] |
Allocation strategy of the ACE_Array_Base.