#include <barray.h>
Inheritance diagram for PLib::BasicArray:
Public Types | |
typedef const T * | const_iterator |
Public Methods | |
int | n () const |
BasicArray () | |
BasicArray (const int ni) | |
BasicArray (const BasicArray< T > &f2) | |
BasicArray (T *ap, const int size) | |
BasicArray (BasicList< T > &list) | |
virtual | ~BasicArray () |
BasicArray< T > & | operator= (const BasicArray< T > &f2) |
int | size () const |
void | resize (const int nsize) |
void | resize (const BasicArray< T > &A) |
void | trim (const int nsize) |
void | clear () |
void | untrim () |
T & | push_back (const T i, int end_buffer=10, double end_mult=-1) |
virtual void | reset (const T val=0.0) |
T | operator= (const T val) |
T & | operator[] (const int i) |
T | operator[] (const int i) const |
T & | elem (const int i) |
T | elem (const int i) const |
T * | memory () const |
void | width (const int w) |
ostream & | print (ostream &os) const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Public Attributes | |
FRIEND_ARRAY_ALLOCATOR typedef T * | iterator |
Protected Attributes | |
int | rsize |
int | wdth |
int | destruct |
int | sze |
T * | x |
Friends | |
int | operator!= (const BasicArray< T > &, const BasicArray< T > &) |
int | operator== (const BasicArray< T > &, const BasicArray< T > &) |
istream & | operator>> (istream &is, BasicArray< T > &arry) |
ostream & | operator<< (ostream &os, const BasicArray< T > &arry) |
This is a basis array class, the only particularity is that the resize is not destructive.
Definition at line 134 of file barray.h.
|
default constructor.
Definition at line 46 of file barray.cpp. Referenced by PLib::Vector< Point3Df >::Vector. |
|
constructor with size specified.
Definition at line 61 of file barray.cpp. |
|
copy constructor.
Definition at line 97 of file barray.cpp. |
|
copy constructor from a pointer.
The BasicArray is constructed from a pointer and a specified size. The desctructor of the class will {\bf not} delete this pointer when it is finished with it. It is up to the function which created it to delete it.
Definition at line 83 of file barray.cpp. |
|
constructor from a linked list.
Definition at line 119 of file barray.cpp. References BasicNode::data, destruct, BasicList::goToFirst, BasicList::goToNext, resize, rsize, BasicList::size, sze, and x. |
|
destructor.
Definition at line 139 of file barray.cpp. References clear. |
|
clear.
Clears the memory and reset the size to 0. You must resize the basic array before using it again.
Definition at line 153 of file barray.cpp. Referenced by ~BasicArray. |
|
|
|
Reimplemented in PLib::Vector. |
|
assignment operator.
Reimplemented in PLib::Vector. Definition at line 172 of file barray.cpp. |
|
sends a BasicArray to an ostream.
Sends a BasicArray to an ostream
Definition at line 339 of file barray.cpp. |
|
adds a new element at the end of the vector.
Definition at line 486 of file barray.cpp. |
|
reset all values of the vetor to val.
Definition at line 216 of file barray.cpp. |
|
Definition at line 152 of file barray.h. Referenced by BasicArray, PLib::Vector::operator=, operator=, and push_back. |
|
shortens the array without destroying the components.
Definition at line 200 of file barray.cpp. |
|
|
|
compares two arrays to see if they're different.
This checks if one of the components of the two arrays are different. A check is made after each comparison to see if they are the same, this speeds up the calculation if the arrays have early different components, otherwise the use of the == operator would yield a faster result.
Definition at line 395 of file barray.cpp. |
|
sends a BasicArray to the ostream.
Definition at line 370 of file barray.cpp. |
|
checks if two arrays are identical.
Definition at line 424 of file barray.cpp. |
|
stores an input string into a vector.
Definition at line 301 of file barray.cpp. |