golib  0.5
goArray< T > Class Template Reference

#include <goarray.h>

Public Member Functions

 goArray (goSize_t s)
 
 goArray (const goArray< T > &other)
 
goIndex_t resize (goIndex_t size)
 
void sort ()
 
void quickSort (goIndex_t, goIndex_t)
 
void sort (goArray< int > &indexArray)
 
void sort (goArray< goSize_t > &indexArray)
 
void sort (goArray< void * > &indexArrays)
 
void quickSort (goIndex_t, goIndex_t, goArray< int > &indexArray)
 
void quickSort (goIndex_t, goIndex_t, goArray< goSize_t > &indexArray)
 
void quickSort (goIndex_t, goIndex_t, goArray< void * > &indexArrays)
 
void byteFill (int f)
 
void fill (T value)
 
void remove (goIndex_t index)
 
goIndex_t getSize () const
 
goIndex_t dim () const
 
T * getPtr ()
 
const T * getPtr () const
 
T & operator[] (goIndex_t idx)
 
const T & operator[] (goIndex_t idx) const
 
goArray< T > & operator= (const goArray< T > &other)
 
goArray< T > & operator+= (T item)
 Resizes the array and adds {\bf item} at the end of it.
 
bool operator== (const goArray< T > &other)
 
bool operator!= (const goArray< T > &other)
 

Protected Attributes

T * Array
 
goIndex_t arraySize
 

Detailed Description

template<class T>
class goArray< T >

Resizeable array.

Author
Christian Gosch

Member Function Documentation

◆ byteFill()

template<class T >
void goArray< T >::byteFill ( int  f)

Fills the array bytewise with byte value f (fast)

Parameters
fByte value to fill the array with

◆ fill()

template<class T>
void goArray< T >::fill ( value)

Fills the array with the given value.

Parameters
valueValue the array is to be filled with.

◆ remove()

template<class T >
void goArray< T >::remove ( goIndex_t  index)

Removes entry at given index. All following entries are moved to the "left".

Attention
This method should be used with caution, since it can be very slow for large arrays.
Parameters
indexThe index of the entry to be removed.

◆ sort()

template<class T >
void goArray< T >::sort ( goArray< int > &  indexArray)

Sort this array and sort indexArray in the same order. Good for keeping track of the original indices.


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