Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Int8Array Class Reference

The Int8Array class is a dynamically sized array that stores __int8 type data, which are the same size as chars, (1 byte). More...

List of all members.

Public Member Functions

 Int8Array ()
 The constructor for Int8Array simply calls the Construct function.
 ~Int8Array ()
 The destructor for Int8Array simply calls the Destruct function.
void Construct ()
 The Construct function readies the internal structure of the Int8Array for use.
void Destruct ()
 The Destruct function cleans up the internal structure of the Int8Array.
void AddInt8 (unsigned __int8 t)
 The AddInt8 function adds a new __int8/char to the Int8Array.
unsigned __int8 ReturnAt (unsigned long i) const
 The ReturnAt function is used to get a __int8/char stored in a specific position within the array.
void AddAt (unsigned long i, unsigned __int8 t)
 The AddAt function replaces an element of the array with a new __int8.
void RemoveAt (unsigned long i)
 The RemoveAt function removes the __int8 at a given position from the Array.
unsigned long NumberOfInt8s () const
 The NumberOfInt8s function returns the number of elements currently in the array.
unsigned long Find (unsigned __int8 v) const
 The Find function returns the index of the first element of a certain __int8 value.

Public Attributes

unsigned __int8 * ar
 The internal array data.
unsigned long size
 The number of available elements in the internal array.
unsigned long used
 The number of elements in the internal array that are currently used.


Detailed Description

The Int8Array class is a dynamically sized array that stores __int8 type data, which are the same size as chars, (1 byte).

This class' implementation is nearly identical to LongArray, CThingArray, and PointerArray.

See also:
LongArray

CThingArray

PointerArray


Constructor & Destructor Documentation

Int8Array::Int8Array  ) 
 

The constructor for Int8Array simply calls the Construct function.

See also:
Int8Array::Construct()

Int8Array::~Int8Array  ) 
 

The destructor for Int8Array simply calls the Destruct function.

See also:
Int8Array::Destruct()


Member Function Documentation

void Int8Array::AddAt unsigned long  i,
unsigned __int8  t
 

The AddAt function replaces an element of the array with a new __int8.

If you try to replace an element at a position greater than the number of elements in the array nothing will happen.

Parameters:
i the index of the element to be replaced.
t the new __int8 that will replace the old one.

void Int8Array::AddInt8 unsigned __int8  t  ) 
 

The AddInt8 function adds a new __int8/char to the Int8Array.

If there is not enough storage in the internal array it will be expanded. The new __int8 is always added to the end of the array. The size of the array is expanded by 8 every time it needs to be resized.

Parameters:
t a __int8 that is to be stored in this Int8Array

void Int8Array::Construct  ) 
 

The Construct function readies the internal structure of the Int8Array for use.

To reset an Int8Array you can call Destruct on it followed by a call to Construct.

See also:
Int8Array::Destruct()

void Int8Array::Destruct  ) 
 

The Destruct function cleans up the internal structure of the Int8Array.

See also:
Int8Array::Construct()

unsigned long Int8Array::Find unsigned __int8  v  )  const
 

The Find function returns the index of the first element of a certain __int8 value.

The find function searches from the first element to the last element and returns the zero based index when it finds the item. If it cannot be found -1, cast to an unsigned long, is returned.

Parameters:
v the value to find
Returns:
the index of the value, or -1 if not found.

void Int8Array::RemoveAt unsigned long  i  ) 
 

The RemoveAt function removes the __int8 at a given position from the Array.

The old __int8 is replaced by what was previously the last __int8 in the array and then the active part of the array is reduced by one. The RemoveAt function does not preserve the order of elements. Attempting to remove a position greater than the number of elements in the array has no effect.

Parameters:
i the index of the __int8 to be removed.

unsigned __int8 Int8Array::ReturnAt unsigned long  i  )  const
 

The ReturnAt function is used to get a __int8/char stored in a specific position within the array.

If you attempt to return a __int8 at a position greater than the number of elements stored in the array 0 will be the result.

Parameters:
i the index of the __int8 to be returned.
Returns:
the __int8 that was requested.


The documentation for this class was generated from the following files:
Generated on Sat Apr 16 16:31:09 2005 for Centum API by  doxygen 1.4.2