In file code/C/generic.H: class GIntArray : public GObject
Code for integer dynamic array class
Inheritance:
public members:
-
- GIntArray()
-
- ~GIntArray()
-
- int SetSize(int asize)
- Sets the size of the array to 'asize' elements
- int GetSize()
- Retrieves the current size of the array, in elements
- int Append(int)
- Appends a value to the end of the array, returns index
- int &Last()
- returns the last value in the array
- int Pop()
- Returns and removes the last value in the array
- int &operator[](int index)
- Overloaded index operator for the array
- GIntArray & operator=( GIntArray &input)
- Overloaded assignment operator for array (copy)
- void Sort(int (*compar)(const void *, const void *))
- Sort the array given a decision function
private members:
-
- int vsize
- The size in chunks
- int size
- The size in elements
- int *array
- Array of objects
- int ChangeSize( int change)
- Function that deals with resizing the array
- int change
- Amount to change array relative to current size
public members:
-
- friend ostream& operator<<(ostream& s, GObject &)
Documentation
This is a dynamic array that grows as needed. Holes are not
allowed in the array so you can not grow the array by more than one
element when allocating. You can explicitly SetSize() if you
want to save time by preventing multiple calls to realloc().
this class has no child classes.
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling