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

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

#include <suitfuncptrvector.h>

Collaboration diagram for SuitFuncPtrVector:
Collaboration graph

Public Member Functions

 SuitFuncPtrVector ()
 This is the default SuitFuncPtrVector constructor. More...
 
 ~SuitFuncPtrVector ()
 This is the SuitFuncPtrVector destructor. More...
 
void resize (SuitFunc *value)
 This will add one new entry to the vector. More...
 
void Delete (int pos, Keeper *const keeper)
 This will delete an entry from the vector. More...
 
int Size () const
 This will return the size of the vector. More...
 
SuitFunc *& operator[] (int pos)
 This will return the value of an element of the vector. More...
 
SuitFunc *const & operator[] (int pos) const
 This will return the value of an element of the vector. More...
 
void readSuitFunction (CommentStream &infile, const char *suitname, const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will read SuitFunc data from the input file. More...
 

Protected Attributes

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

Detailed Description

This class implements a dynamic vector of SuitFunc values.

Constructor & Destructor Documentation

◆ SuitFuncPtrVector()

SuitFuncPtrVector::SuitFuncPtrVector ( )
inline

This is the default SuitFuncPtrVector constructor.

◆ ~SuitFuncPtrVector()

SuitFuncPtrVector::~SuitFuncPtrVector ( )

This is the SuitFuncPtrVector destructor.

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

Member Function Documentation

◆ Delete()

void SuitFuncPtrVector::Delete ( int  pos,
Keeper *const  keeper 
)

This will delete an entry from the vector.

Parameters
posis the element of the vector to be deleted
keeperis the Keeper for the current model
Note
This will free the memory allocated to the deleted element of the vector

◆ operator[]() [1/2]

SuitFunc*& SuitFuncPtrVector::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]

SuitFunc* const& SuitFuncPtrVector::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

◆ readSuitFunction()

void SuitFuncPtrVector::readSuitFunction ( CommentStream infile,
const char *  suitname,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This function will read SuitFunc data from the input file.

Parameters
infileis the CommentStream to read suitability function data from
suitnameis the name for the suitability function
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ resize()

void SuitFuncPtrVector::resize ( SuitFunc value)

This will add one new entry to the vector.

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

◆ Size()

int SuitFuncPtrVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

Member Data Documentation

◆ size

int SuitFuncPtrVector::size
protected

This is the size of the vector.

◆ v

SuitFunc** SuitFuncPtrVector::v
protected

This is the vector of SuitFunc values.


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