oaArrayBase Class Template Reference

Inheritance diagram for oaArrayBase:

oaArray oaArray<oaAnalysisPoint *> oaArray<oaAntennaArea> oaArray<oaBox> oaArray<oaBuildInfo *> oaArray<oaByte> oaArray<oaComplex<obj>> oaArray<oaConstraintParam *> oaArray<oaDerivedLayerParam *> oaArray<oaDesign *> oaArray<oaDesignObject *> oaArray<oaDMAttr> oaArray<oaDualInt> oaArray<oaFeature *> oaArray<oaFig *> oaArray<oaGroupDef *> oaArray<oaIntRange> oaArray<oaLayerHeader *> oaArray<oaLayerMap> oaArray<oaLayerNum> oaArray<oaManagedType> oaArray<oaModTerm *> oaArray<oaObject *> oaArray<oaOccTerm *> oaArray<oaParam> oaArray<oaPoint> oaArray<oaPurposeNum> oaArray<oaSiteRef> oaArray<oaString> oaArray<oaTech *> oaArray<oaTechHeader *> oaArray<oaTerm *> oaArray<oaValue *> oaArray<oaViaDef *> oaArray<oaViaTopology>


Public Methods

 oaArrayBase (oaUInt4 size=0)
 oaArrayBase (const oaArrayBase< T > &arrayIn)
 oaArrayBase (const T arrayIn[], oaUInt4 numElementsIn)
 ~oaArrayBase ()
oaArrayBase< T > & operator= (const oaArrayBase< T > &arrayIn)
const T * getElements () const
oaUInt4 getNumElements () const
oaUInt4 getSize () const
void setNumElements (oaUInt4 n)
void setSize (oaUInt4 newSize, oaBoolean saveElements=false)
void set (const T *arrayIn, oaUInt4 numElementsIn)
const T & get (oaUInt4 index) const
T & get (oaUInt4 index)
const T & operator[] (oaUInt4 i) const
T & operator[] (oaUInt4 i)

Detailed Description

template<class T>
class oaArrayBase< T >

The oaArrayBase<> class implements a template for an array of elements. The size of the array can be different than the number of elements actually stored. This is useful in situations where the array is being used as a buffer because it reduces the need to re-allocate the array.


Constructor & Destructor Documentation

template<class T>
oaArrayBase< T >::oaArrayBase oaUInt4    size = 0 [inline]
 

This oaArrayBase constructor allocates enough storage to hold the specified size number of elements.

Parameters:
size Specifies the storage to allocate for size elements

template<class T>
oaArrayBase< T >::oaArrayBase const oaArrayBase< T > &    arrayIn [inline]
 

This oaArrayBase constructor copies the elements of the specified arrayIn.

Parameters:
arrayIn The oaArrayBase to copy

template<class T>
oaArrayBase< T >::oaArrayBase const T    array[],
oaUInt4    numElementsIn
[inline]
 

This oaArrayBase constructor uses a C-style array[] of T elements to specify the initial contents of the array.

Parameters:
array[] array[] C-style array of T elements
numElementsIn numElementsIn number elements

template<class T>
oaArrayBase< T >::~oaArrayBase   [inline]
 

This is the destructor for the oaArrayBase class. It frees the storage associated with this oaArrayBase.


Member Function Documentation

template<class T>
T & oaArrayBase< T >::get oaUInt4    index [inline]
 

This function returns a reference to the element in this array at the specified index. Note that this function does not check whether the index is valid.

Parameters:
index Specifies the index element in the array to access

template<class T>
const T & oaArrayBase< T >::get oaUInt4    index const [inline]
 

This function returns a const reference to the element in this array at the specified index. Note that this function does not check whether the index is valid.

Parameters:
index Specifies the index element in the array to access

template<class T>
const T * oaArrayBase< T >::getElements   const [inline]
 

This function returns a const pointer to the elements in this oaArrayBase array. This may be useful to those applications that want to memcpy the data in this array.

template<class T>
oaUInt4 oaArrayBase< T >::getNumElements   const [inline]
 

This function returns the number of elements this oaArrayBase array contains.

template<class T>
oaUInt4 oaArrayBase< T >::getSize   const [inline]
 

This function returns the allocated size of this oaArrayBase array. The number of elements may be less than the allocated size of the array.

template<class T>
oaArrayBase & oaArrayBase< T >::operator= const oaArrayBase< T > &    arrayIn [inline]
 

This is the assignment operator for the oaArrayBase class. It clears this array and copies the elements in arrayIn to this array.

Parameters:
arrayIn rhs array to copy to this array

template<class T>
T & oaArrayBase< T >::operator[] oaUInt4    index [inline]
 

This function is a convenient synonym for get(index).

Parameters:
index Specifies the index'th element in the array to access

template<class T>
const T & oaArrayBase< T >::operator[] oaUInt4    index const [inline]
 

This function is a convenient synonym for get(index).

Parameters:
index Specifies the index'th element in the array to access

template<class T>
void oaArrayBase< T >::set const T *    array,
oaUInt4    numElements
 

This function copies numElements from the specified C-style array to this array. The size of this array is set to numElements.

Parameters:
array pointer to the array to copy
numElements number of elements to copy

template<class T>
void oaArrayBase< T >::setNumElements oaUInt4    n [inline]
 

This function sets the number of elements in this oaArrayBase array to the specified n value. The specified value is not checked against the actual size of the array. This is normally used when an application first sets the size of the array, fills it in, and then sets the number of elements the array contains.

Parameters:
n Specifies the number of elements this array contains

template<class T>
void oaArrayBase< T >::setSize oaUInt4    newSize,
oaBoolean    saveElements = false
[inline]
 

This function resizes this oaArrayBase to contain the specified newSize number of elements. If saveData is false, this oaArrayBase is not initialized. If true, the original data is preserved. If newSize is less than numObjs, all of the data will not be preserved.

Parameters:
newSize the new size of the oaArrayBase
saveElements indicates whether the resized array will be reinitialized (saveElements = false) or the current data (up to and including the number of elements specified by newSize) will be preserved (saveElements = true)


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

Return to top of page