![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
TGPoint3DArray
TGRPoint3DArray
TGRPointArray
TGPointArray
Purpose:
TRawArray provides a low-level substitute for traditional C arrays created with malloc and free. Unlike other C++ objects, the storage is managed with low-level heap operations. TRawArray's implementation can be seen in its header file.
Warning: Only primitive types and objects with no virtual member functions should be stored in TRawArray. Because TRawArray does not call constructors for the space it allocates, objects with vtables are not properly initialized, resulting in mysterious crashes.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TRawArray (unsigned long size =0)
- TRawArray (const TRawArray < AType > & source)
Interface Category:
API.
Purpose:
- Creates an TRawArray of type AType of the specified size. The items of the array are not initialized.
- Creates a TRawArray of type AType that is a copy of the specified array.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- unsigned long size =0 -The size of the array.
- const TRawArray < AType > & source -The array to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
~ TRawArray ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called 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: TRawArray::GetValue
AType GetValue (unsigned long i) const
Interface Category:
API.
Purpose:
Get the item of type AType at the specified index.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index.
Return Value:
The member of the array at the specified index.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::SetValue
void SetValue (unsigned long i, const AType & p)
Interface Category:
API.
Purpose:
Sets the item of the TRawArray at the specified index, to the specified value.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index.
- const AType & p -The new value.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::GetNumberOfValues
unsigned long GetNumberOfValues () const
Interface Category:
API.
Purpose:
Returns the number of items in the TRawArray; in other words, the size of the array.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The number of items in the array.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::Resize
void Resize (unsigned long newsize)
Interface Category:
API.
Purpose:
Sets the size of the TRawArray to the specified size.
Calling Context:
Call this function directly.
Parameters:
- unsigned long newsize -The new size.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The items of the array are not initialized.
Member Function: TRawArray::Swap
void Swap (TRawArray < AType > & victim)
Interface Category:
API.
Purpose:
Swaps the contents of the TRawArray with the specified array.
Calling Context:
Call this function directly.
Parameters:
- TRawArray < AType > & victim -The array containing the items to be swapped with those of this TRawArray.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::operator>>=
TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream which the object's data is streamed out to.
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: TRawArray::operator<<=
TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream which the object's data is streamed in from.
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: TRawArray::operator=
TRawArray < AType > & operator =(const TRawArray < AType > & obj)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TRawArray < AType > & obj -The array whose value is to be copied.
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: TRawArray::operator==
bool operator ==(const TRawArray < AType > & obj) const
Interface Category:
API.
Purpose:
Tests two TRawArrays for equality. If the two arrays are not of equal length, false is returned.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TRawArray < AType > & obj -The point to be compared to this array.
Return Value:
Returns true if all the items in the two arrays are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::operator!=
bool operator != (const TRawArray < AType > & obj) const
Interface Category:
API.
Purpose:
Tests two TRawArrays for inequality.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TRawArray < AType > & obj -The array to be compared to this array.
Return Value:
Returns true if any of the items in the two arrays are unequal, or if the two arrays are of different length.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRawArray::SetGrowIncrement
void SetGrowIncrement (unsigned long increment)
Interface Category:
API.
Purpose:
The size of a RawArray is increased in fixed "clumps" to prevent thrashing the storage allocator when Append is called. This allows the clump size to be changed.
Calling Context:
Call directly.
Parameters:
- unsigned long increment -The number of values in each "clump."
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Member Function: TRawArray::GetGrowIncrement
unsigned long GetGrowIncrement () const
Interface Category:
API.
Purpose:
This returns the GrowIncrement set by SetGrowIncrement.
Calling Context:
Call directly.
Parameters:
Return Value:
The grow increment, as number of values.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Member Function: TRawArray::operator[]
- AType & operator [] (unsigned long i)
- const AType & operator [] (unsigned long i) const
Interface Category:
API.
Purpose:
- Returns a reference to the indexed object.
- Returns a constant reference to the indexed object.
Calling Context:
- Called via the [] operator.
- Called via the [] operator when referencing a const TRawArray
Parameters:
- unsigned long i -Index of object referenced.
- unsigned long i -Index of object referenced.
Return Value:
The indexed value.
Exceptions:
This does NOT check array bounds, but instead does a straight C index. If the index is out of range, bad data or a processor exception may result.
Concurrency:
Not multithread safe.
Other Considerations:
Member Function: TRawArray::Append
void Append (const AType & p)
Interface Category:
API.
Purpose:
Appends an item to a RawArray, extending the size if needed.
Calling Context:
Call directly.
Parameters:
- const AType & p -Value to be added.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The array needs to be grown, it is extended by the amount specified by SetGrowIncrement
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.