Inheritance diagram for oaArray:
Public Methods | |
oaArray (oaUInt4 size=0) | |
oaArray (const oaArray< T > &arrayIn) | |
oaArray (const T arrayIn[], oaUInt4 numElementsIn) | |
virtual | ~oaArray () |
oaUInt4 | find (const T &element) const |
void | append (const T &element) |
void | append (const oaArray< T > &arrayIn) |
void | remove (const T &element) |
void | sort (int(*compare)(const T *, const T *)) |
oaArray< T > & | operator= (const oaArray< T > &arrayIn) |
virtual oaBoolean | operator== (const oaArray< T > &other) const |
oaBoolean | operator!= (const oaArray< T > &other) const |
Different objects derive an array class that is specific to what they need to manipulate with the array, such as the oaTermArray and oaModTermArray classes. These object specific arrays may add to the basic capabilities provided by the oaArray class.
|
This is the constructor for the oaArray template class that constructs an array allocated with enough storage to hold the number of elements specified by size.
|
|
This is the constructor for the oaArray template class that constructs an array by making a copy of the specified arrayIn.
|
|
This is the constructor for the oaArray template that uses a C-style array[] of T elements to specify the initial contents of the array.
|
|
This is the destructor for the oaArray class. It frees the storage associated with this oaArray. |
|
This function appends the specified array to the end of this array. This function will increase the size of the array if necessary to fit the specified array contents and will update the number of elements in this array.
|
|
This function appends the specified element to the end of this array. This function will increase the size of the array if necessary and will increment the number of elements in the array.
|
|
This function searches this array for the specified element. The position of the element in the array is returned if found. Otherwise, the value oacNullIndex is returned.
Reimplemented in oaParamArray. |
|
This is the inequality operator for this array. This function returns a boolean indicating whether this array is not equivalent to the specified array.
|
|
This is the assignment operator for this array. It copies the given array into this array, resizing the array if necessary.
|
|
This is the equality operator for this array. This function returns a boolean indicating whether this array is equivalent to the specified array.
Reimplemented in oaParamArray. |
|
This function removes the specified element from this array, shifting the remaining elements up to fill in the gap. The number of elements is decremented accordingly.
|
|
This function sorts the elements of the array in-place, using qsort() and a user-supplied comparison function that is called by qsort to compare two successive elements in the array. sort() takes one argument -- a pointer to the user-supplied compare function. Users supply the name of the compare function to sort() to pass this pointer as shown in the sample code, below). The user-supplied compare routine, which is used by qsort(), should take pointers to two elements in the oaArray<T> of type <T> and, for an ascending sort, return the following values for each compare operation:
Example Sort of Integer Array
// user-supplied compare function static int compareIntsForQsort(const int *elem1, const int *elem2) { return *elem1 - *elem2; } // main routine oaArray<int> intArray(3); intArray[0] = 1; intArray[1] = 3; intArray[2] = 2; intArray.sort(compareIntsForQsort); // check for ordered array assert(intArray[0] == 1); assert(intArray[1] == 2); assert(intArray[2] == 3); |
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.