PadPage class public functions

PadPage
~PadPage
aquire
empty
free
initialize
insert
getNumFreeSpaces
getNumUsedSpaces
getSize
getStatus
operator[]
setSize

PadPage(int aSize = 1024);
Sets the allocated size of the page to aSize number of elements.

void ~PadPage();
Deletes storage space for element array.

int aquire(void);
Reserves space in the page for an element. Returns -1 if there is no space left to store element. Use free to release the space again.

void empty(void);
Frees all elements in the array.

void free(int index);
Frees space taken up by element for reuse.

void initialize(type& aThing);
Sets all unused elements in the storage area to the specified value.

int insert(type& aThing);
Reserves space and copyies aThing into the page. Returns the index of the element storage area in the page, or -1 if no space is available to insert element.

int getNumFreeSpaces(void);
Returns the number of elements which are free and can be reserved in the page.

int getNumUsedSpaces(void);
Returns the number of elements being used in the page.

int getSize(void);
Returns the number of elements being used in the page.

void getStatus(void);
Returns true if the element index is being used. Returns fase if the element index is not reserved.

void operator[](void);
Treat the page storage space as an array and access an element whether in use or nor. Usage can be checked with getStatus().

void setSize(void);
Frees all spaces in the page storage area and uninitializes any initialized spaces.