|
Gadget
|
This class implements a dynamic vector of int values. More...
#include <intvector.h>

Public Member Functions | |
| IntVector () | |
| This is the default IntVector constructor. More... | |
| IntVector (int sz, int initial) | |
| This is the IntVector constructor for a specified size with an initial value. More... | |
| IntVector (const IntVector &initial) | |
| This is the IntVector constructor that creates a copy of an existing IntVector. More... | |
| ~IntVector () | |
| This is the IntVector destructor. More... | |
| void | resize (int addsize, int value) |
| This will add new entries to the vector. More... | |
| void | Delete (int pos) |
| This will delete an entry from the vector. More... | |
| int | Size () const |
| This will return the size of the vector. More... | |
| int & | operator[] (int pos) |
| This will return the value of an element of the vector. More... | |
| const int & | operator[] (int pos) const |
| This will return the value of an element of the vector. More... | |
| void | Reset () |
| This will reset the vector. More... | |
| void | setToZero () |
| This function will set all of the entries of the vector to zero. More... | |
| IntVector & | operator= (const IntVector &iv) |
| This operator will set the vector equal to an existing IntVector. More... | |
Protected Attributes | |
| int * | v |
| This is the vector of int values. More... | |
| int | size |
| This is the size of the vector. More... | |
This class implements a dynamic vector of int values.
|
inline |
This is the default IntVector constructor.
| IntVector::IntVector | ( | int | sz, |
| int | initial | ||
| ) |
This is the IntVector constructor for a specified size with an initial value.
| sz | is the size of the vector to be created |
| initial | is the initial value for all the entries of the vector |
| IntVector::IntVector | ( | const IntVector & | initial | ) |
| IntVector::~IntVector | ( | ) |
This is the IntVector destructor.
| void IntVector::Delete | ( | int | pos | ) |
This will delete an entry from the vector.
| pos | is the element of the vector to be deleted |
|
inline |
This will return the value of an element of the vector.
| pos | is the element of the vector to be returned |
|
inline |
This will return the value of an element of the vector.
| pos | is the element of the vector to be returned |
| void IntVector::Reset | ( | ) |
This will reset the vector.
| void IntVector::resize | ( | int | addsize, |
| int | value | ||
| ) |
This will add new entries to the vector.
| addsize | is the number of new entries to the vector |
| value | is the value that will be entered for the new entries |
| void IntVector::setToZero | ( | ) |
This function will set all of the entries of the vector to zero.
|
inline |
This will return the size of the vector.
|
protected |
This is the size of the vector.
|
protected |
This is the vector of int values.