#include <iso_data_array.h>
Collaboration diagram for iso::data::Array< Type >:
Public Member Functions | |
Array () | |
default constructor | |
Array (unsigned int pCount) | |
parameter based constructor | |
Array (unsigned int pCount, Type pValue) | |
parameter based constructor | |
Array (unsigned int pCount, Type *pValues) | |
parameter based constructor | |
Array (unsigned int pCount, double pValue1, double pValue2,...) | |
parameter based constructor | |
Array (const Array< Type > &pArray) | |
copy constructor | |
virtual | ~Array () |
destructor | |
unsigned int | dataCount () const |
return element count | |
Type * | data () |
return array values | |
const Type * | data () const |
return array values | |
Type & | operator[] (unsigned int pIndex) throw (base::Exception) |
access element | |
const Type & | operator[] (unsigned int pIndex) const throw (base::Exception) |
access element | |
void | clear () |
set all array elements to 0 | |
void | resize (unsigned int pCount) |
change size of array | |
void | set (Type pValue) |
set all array elements to pValue | |
void | set (Type pValue, unsigned int pCount) |
resize array and set all array elements to pValue | |
void | set (Type *pValues) |
set all array elements to the values in the pValues | |
void | set (const Array< Type > &pArray, bool pResize=false) throw (base::Exception) |
copy all array elements from pArray | |
const Array< Type > & | operator= (Type pValue) |
set all array elements to value | |
const Array< Type > & | operator= (const Array< Type > &pArray) throw (base::Exception) |
copy all array elements from pArray | |
bool | operator== (const Array< Type > &pArray) const |
array == array | |
bool | operator!= (const Array< Type > &pArray) const |
array != array | |
base::String | info () const |
print textual array information | |
Public Attributes | |
Type * | e |
array elements | |
Protected Attributes | |
unsigned int | mCount |
number of array elements | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const Array< Type > &pArray) |
print array information |
one dimensional resizable array class that implements boundary checks
Created by Daniel Bisig on 7/16/06. Copyright 2006 Daniel Bisig All rights reserved.
iso::data::Array< Type >::Array | ( | ) |
default constructor
iso::data::Array< Type >::Array | ( | unsigned int | pCount | ) |
parameter based constructor
pCount | number of array elements |
iso::data::Array< Type >::Array | ( | unsigned int | pCount, | |
Type | pValue | |||
) |
parameter based constructor
pCount | number of array elements | |
pValue | value of all array components |
iso::data::Array< Type >::Array | ( | unsigned int | pCount, | |
Type * | pValues | |||
) |
parameter based constructor
pCount | number of array elements | |
pValues | array of values of vector components |
iso::data::Array< Type >::Array | ( | unsigned int | pCount, | |
double | pValue1, | |||
double | pValue2, | |||
... | ||||
) |
parameter based constructor
pCount | number of array elements | |
pValue1 | first value of a series of values | |
pValue2 | second value of a series of values |
iso::data::Array< Type >::Array | ( | const Array< Type > & | pArray | ) |
copy constructor
pArray | vector |
iso::data::Array< Type >::~Array | ( | ) | [virtual] |
destructor
unsigned int iso::data::Array< Type >::dataCount | ( | ) | const [inline] |
return element count
Type * iso::data::Array< Type >::data | ( | ) |
return array values
const Type * iso::data::Array< Type >::data | ( | ) | const |
return array values
Type & iso::data::Array< Type >::operator[] | ( | unsigned int | pIndex | ) | throw (base::Exception) [inline] |
access element
pIndex | index of element |
Exception | index out of range |
const Type & iso::data::Array< Type >::operator[] | ( | unsigned int | pIndex | ) | const throw (base::Exception) [inline] |
access element
pIndex | index of element |
Exception | index out of range |
void iso::data::Array< Type >::clear | ( | ) | [inline] |
set all array elements to 0
void iso::data::Array< Type >::resize | ( | unsigned int | pCount | ) |
change size of array
pCount | new array size |
void iso::data::Array< Type >::set | ( | Type | pValue | ) | [inline] |
set all array elements to pValue
pValue | value |
void iso::data::Array< Type >::set | ( | Type | pValue, | |
unsigned int | pCount | |||
) | [inline] |
resize array and set all array elements to pValue
pCount | new array size | |
pValue | value |
void iso::data::Array< Type >::set | ( | Type * | pValues | ) | [inline] |
set all array elements to the values in the pValues
pValues | values |
void iso::data::Array< Type >::set | ( | const Array< Type > & | pArray, | |
bool | pResize = false | |||
) | throw (base::Exception) [inline] |
copy all array elements from pArray
pArray | array | |
pResize | resize array if size differs |
Exception | arrays not of same size |
const Array< Type > & iso::data::Array< Type >::operator= | ( | Type | pValue | ) | [inline] |
set all array elements to value
pValue | value |
const Array< Type > & iso::data::Array< Type >::operator= | ( | const Array< Type > & | pArray | ) | throw (base::Exception) [inline] |
copy all array elements from pArray
pArray | array |
Exception | arrays not of same size |
bool iso::data::Array< Type >::operator== | ( | const Array< Type > & | pArray | ) | const [inline] |
array == array
pArray | comparison array |
bool iso::data::Array< Type >::operator!= | ( | const Array< Type > & | pArray | ) | const [inline] |
array != array
pArray | comparison array |
base::String iso::data::Array< Type >::info | ( | ) | const |
print textual array information
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Array< Type > & | pArray | |||
) | [friend] |
print array information
pOstream | output stream | |
pArray | array |
Type* iso::data::Array< Type >::e |
array elements
unsigned int iso::data::Array< Type >::mCount [protected] |
number of array elements