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

# ACE_Array Class Template Reference

A dynamic array class. More...

`#include <Containers_T.h>`

Inheritance diagram for ACE_Array:

[legend]
Collaboration diagram for ACE_Array:

[legend]
List of all members.

## Public Types
typedef T | TYPE
typedef ACE_Array_Iterator< T > | ITERATOR
## Public Methods
| ACE_Array (size_t size=0, ACE_Allocator *alloc=0)
| Initialize an empty array of the specified size using the provided allocation strategy. More...
| ACE_Array (size_t size, const T &default_value, ACE_Allocator *alloc=0)
| Initialize an array the given size placing the default_value in each index. More...
| ACE_Array (const ACE_Array< T > &s)
| The copy constructor performs initialization by making an exact copy of the contents of parameter <s>, i.e., *this == s will return true. More...
void | operator= (const ACE_Array< T > &s)
| Assignment operator performs an assignment by making an exact copy of the contents of parameter <s>, i.e., *this == s will return true. More...
int | operator== (const ACE_Array< T > &s) const
| Compare this array with <s> for equality. More...
int | operator!= (const ACE_Array< T > &s) const
| Compare this array with <s> for inequality such that <*this> != <s> is always the complement of the boolean return value of <*this> == <s>. More...

## Detailed Description

### template<class T>
class ACE_Array< T >

A dynamic array class.

This class extends ACE_Array_Base, adding comparison operators.

Requirements and Performance Characteristics

- Internal Structure Dynamic array
- Duplicates allowed? Yes
- Random access allowed? Yes
- Search speed N/A
- Insert/replace speed O(1)
- Iterator still valid after change to container?
  - In general, yes.
  - If array size is changed during iteration, no.
- Frees memory for removed elements? No
- Items inserted by Value
- Requirements for contained type
  1. Default constructor
  2. Copy constructor
  3. operator=
  4. operator!=

See also:
  ACE_Array_Base. This class inherits its operations and requirements.

## Member Typedef Documentation

template<class T>
typedef ACE_Array_Iterator<T> ACE_Array::ITERATOR

| Reimplemented from ACE_Array_Base.

template<class T>
typedef T ACE_Array::TYPE

| Reimplemented from ACE_Array_Base.

## Constructor & Destructor Documentation

template<class T>
ACE_INLINE ACE_Array< T >::ACE_Array | ( | size_t | size = 0,
|  | ACE_Allocator * | alloc = 0
| ) |

| Initialize an empty array of the specified size using the provided allocation strategy.

template<class T>
ACE_INLINE ACE_Array< T >::ACE_Array | ( | size_t | size,
|  | const T & | default_value,
|  | ACE_Allocator * | alloc = 0
| ) |

| Initialize an array the given size placing the default_value in each index.

template<class T>
ACE_INLINE ACE_Array< T >::ACE_Array | ( | const ACE_Array< T > & | s | ) |

| The copy constructor performs initialization by making an exact copy of the contents of parameter <s>, i.e., *this == s will return true.

## Member Function Documentation

template<class T>
ACE_INLINE int ACE_Array< T >::operator!= | ( | const ACE_Array< T > & | s | ) | const

| Compare this array with <s> for inequality such that <*this> != <s> is always the complement of the boolean return value of <*this> == <s>.

template<class T>
ACE_INLINE void ACE_Array< T >::operator= | ( | const ACE_Array< T > & | s | ) |

| 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>.

template<class T>
int ACE_Array< T >::operator== | ( | const ACE_Array< T > & | s | ) | const

| Compare this array with <s> for equality. Two arrays are equal if their <size>'s are equal and all the elements from 0 .. <size> are equal.

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

- Containers_T.h
- Containers_T.cpp
- Containers_T.i