Gadget
Public Member Functions | Protected Attributes | List of all members
PredatorPtrVector Class Reference

This class implements a dynamic vector of Predator values. More...

#include <predatorptrvector.h>

Collaboration diagram for PredatorPtrVector:
Collaboration graph

Public Member Functions

 PredatorPtrVector ()
 This is the default PredatorPtrVector constructor. More...
 
 PredatorPtrVector (const PredatorPtrVector &initial)
 This is the PredatorPtrVector constructor that creates a copy of an existing PredatorPtrVector. More...
 
 ~PredatorPtrVector ()
 This is the PredatorPtrVector destructor. More...
 
void resize (Predator *value)
 This will add one new entry 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...
 
Predator *& operator[] (int pos)
 This will return the value of an element of the vector. More...
 
Predator *const & operator[] (int pos) const
 This will return the value of an element of the vector. More...
 

Protected Attributes

Predator ** v
 This is the vector of Predator values. More...
 
int size
 This is the size of the vector. More...
 

Detailed Description

This class implements a dynamic vector of Predator values.

Constructor & Destructor Documentation

◆ PredatorPtrVector() [1/2]

PredatorPtrVector::PredatorPtrVector ( )
inline

This is the default PredatorPtrVector constructor.

◆ PredatorPtrVector() [2/2]

PredatorPtrVector::PredatorPtrVector ( const PredatorPtrVector initial)

This is the PredatorPtrVector constructor that creates a copy of an existing PredatorPtrVector.

Parameters
initialis the PredatorPtrVector to copy

◆ ~PredatorPtrVector()

PredatorPtrVector::~PredatorPtrVector ( )

This is the PredatorPtrVector destructor.

Note
This will free all the memory allocated to all the elements of the vector

Member Function Documentation

◆ Delete()

void PredatorPtrVector::Delete ( int  pos)

This will delete an entry from the vector.

Parameters
posis the element of the vector to be deleted
Note
This will free the memory allocated to the deleted element of the vector

◆ operator[]() [1/2]

Predator*& PredatorPtrVector::operator[] ( int  pos)
inline

This will return the value of an element of the vector.

Parameters
posis the element of the vector to be returned
Returns
the value of the specified element

◆ operator[]() [2/2]

Predator* const& PredatorPtrVector::operator[] ( int  pos) const
inline

This will return the value of an element of the vector.

Parameters
posis the element of the vector to be returned
Returns
the value of the specified element

◆ resize()

void PredatorPtrVector::resize ( Predator value)

This will add one new entry to the vector.

Parameters
valueis the value that will be entered for the new entry

◆ Size()

int PredatorPtrVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

Member Data Documentation

◆ size

int PredatorPtrVector::size
protected

This is the size of the vector.

◆ v

Predator** PredatorPtrVector::v
protected

This is the vector of Predator values.


The documentation for this class was generated from the following files: