Class: TPrimitiveTypeArray

Declaration: PrimitiveArray.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TSampledSurfacePointArray

Purpose:

TPrimitiveTypeArray is an implementation of a type-safe owning array. It takes ownership of the arguments passed to it. It supports all the regular operations of arrays, plus some convenience operations.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

No classes should be derived from TPrimitiveTypeArray.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::TPrimitiveTypeArray

  1. TPrimitiveTypeArray (PrimitiveArrayCount size =0)
  2. TPrimitiveTypeArray (const TPrimitiveTypeArray < AType > & source)

Interface Category:

API.

Purpose:

  1. Constructor. The primitive array is empty and the default size is set to zero (0). The default value should be changed to the expected initial size of the array.
  2. Copy constructor.

Calling Context:

  1. Call this function directly to create either an empty or a specific size array.
  2. Call this function directly to copy another array.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::~TPrimitiveTypeArray

~ TPrimitiveTypeArray ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Call this function directly to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::GetValue

AType GetValue (PrimitiveArrayCount i) const

Interface Category:

API.

Purpose:

Gets the value from a specific array index.

Calling Context:

Call this function directly to get the values from the array.

Parameters:

Return Value:

The value stored at the passed index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::SetValue

void SetValue (PrimitiveArrayCount i, const AType & p)

Interface Category:

API.

Purpose:

Enters a value into the array.

Calling Context:

Call this function directly to enter a value into the array at a specific index location.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::GetNumberOfValues

PrimitiveArrayCount GetNumberOfValues () const

Interface Category:

API.

Purpose:

Gets the number of values present in the array.

Calling Context:

Call this function directly to find out the number of values in the array.

Parameters:

Return Value:

The number of values present in the array.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::Resize

void Resize (PrimitiveArrayCount newsize)

Interface Category:

API.

Purpose:

Resizes the array.

Calling Context:

Call this function directly to resize the array to a greater size.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Will not resize an array to a size smaller than the present size.

Member Function: TPrimitiveTypeArray::operator[]

  1. AType & operator [] (PrimitiveArrayCount i)
  2. AType & operator [] (PrimitiveArrayCount i) const

Interface Category:

API.

Purpose:

  1. Retrieves the array elements.
  2. Retrieves the array elements from a constant context.

Calling Context:

  1. Call this function directly to retrieve the array elements.
  2. Call this function directly to retrieve the array elements from a constant context.

Parameters:

Return Value:

A reference to the value at the index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Call this function directly to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::operator<<=

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Call this function directly to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::operator=

TPrimitiveTypeArray < AType > & operator =(const TPrimitiveTypeArray < AType > & obj)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function directly when an array is assigned to another compatible array.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::operator==

bool operator ==(const TPrimitiveTypeArray < AType > & obj) const

Interface Category:

API.

Purpose:

Compares two objects for equality.

Calling Context:

Call this function directly to check for equality of items contained in the array, in terms of location and value.

Parameters:

Return Value:

Returns true if the items in the array are equal; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrimitiveTypeArray::operator!=

bool operator != (const TPrimitiveTypeArray < AType > & obj) const

Interface Category:

API.

Purpose:

Compares two objects for inequality.

Calling Context:

Call this function directly to check for inequality of items contained in the array, in terms of location and value.

Parameters:

Return Value:

Returns true if the items in the array are not equal; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.