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

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

#include <popratiovector.h>

Collaboration diagram for PopRatioVector:
Collaboration graph

Public Member Functions

 PopRatioVector ()
 This is the default PopRatioVector constructor. More...
 
 PopRatioVector (int sz, PopRatio initial)
 This is the PopRatioVector constructor for a specified size with an initial value. More...
 
 PopRatioVector (const PopRatioVector &initial)
 This is the PopRatioVector constructor that creates a copy of an existing PopRatioVector. More...
 
 ~PopRatioVector ()
 This is the PopRatioVector destructor. More...
 
void resize (PopRatio value)
 This will add one new entry to the vector. More...
 
void resize (double *num, double rat)
 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...
 
PopRatiooperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const PopRatiooperator[] (int pos) const
 This will return the value of an element of the vector. More...
 

Protected Attributes

PopRatiov
 This is the vector of PopRatio values. More...
 
int size
 This is the size of the vector. More...
 

Detailed Description

This class implements a dynamic vector of PopRatio values.

Constructor & Destructor Documentation

◆ PopRatioVector() [1/3]

PopRatioVector::PopRatioVector ( )
inline

This is the default PopRatioVector constructor.

◆ PopRatioVector() [2/3]

PopRatioVector::PopRatioVector ( int  sz,
PopRatio  initial 
)

This is the PopRatioVector constructor for a specified size with an initial value.

Parameters
szis the size of the vector to be created
initialis the initial value for all the entries of the vector

◆ PopRatioVector() [3/3]

PopRatioVector::PopRatioVector ( const PopRatioVector initial)

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

Parameters
initialis the PopRatioVector to copy

◆ ~PopRatioVector()

PopRatioVector::~PopRatioVector ( )

This is the PopRatioVector destructor.

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

Member Function Documentation

◆ Delete()

void PopRatioVector::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]

PopRatio& PopRatioVector::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]

const PopRatio& PopRatioVector::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() [1/2]

void PopRatioVector::resize ( double *  num,
double  rat 
)

This will add one new entry to the vector.

Parameters
numis the value of N for the new PopRatio entry
ratis the value of R for the new PopRatio entry

◆ resize() [2/2]

void PopRatioVector::resize ( PopRatio  value)

This will add one new entry to the vector.

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

◆ Size()

int PopRatioVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

Member Data Documentation

◆ size

int PopRatioVector::size
protected

This is the size of the vector.

◆ v

PopRatio* PopRatioVector::v
protected

This is the vector of PopRatio values.


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