Modernized GAlib
3.0.0 current
|
Array Base Class. More...
#include <GAArray.h>
Public Member Functions | |
GAArray (unsigned int s) | |
GAArray (const GAArray< T > &orig) | |
GAArray< T > & | operator= (const GAArray< T > &orig) |
GAArray< T > * | clone () |
const T & | operator[] (unsigned int i) const |
T & | operator[] (unsigned int i) |
void | copy (const GAArray< T > &orig) |
void | copy (const GAArray< T > &orig, unsigned int dest, unsigned int src, unsigned int length) |
void | move (unsigned int dest, unsigned int src, unsigned int length) |
void | swap (unsigned int i, unsigned int j) |
int | size () const |
int | size (unsigned int n) |
bool | equal (const GAArray< T > &b, unsigned int dest, unsigned int src, unsigned int length) const |
template<class U > | |
bool | operator== (const GAArray< U > &rhs) const |
template<class U > | |
bool | operator!= (const GAArray< U > &rhs) const |
Protected Attributes | |
std::vector< T > | a |
the contents of the array | |
Array Base Class.
This class can be used only on objects that have:
operator=
operator==
operator!=
In other words, use only primitive objects in this array (e.g. int, float, pointers, etc) The constructor will try to initialize to zero, but only if the type is right. We don't do any over-allocation, so resizing can be expensive. No error checking on the copy, so don't walk over end of array!
T |