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

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

#include <modelvariablevector.h>

Collaboration diagram for ModelVariableVector:
Collaboration graph

Public Member Functions

 ModelVariableVector ()
 This is the default ModelVariableVector constructor. More...
 
 ~ModelVariableVector ()
 This is the ModelVariableVector destructor. More...
 
void setsize (int addsize)
 This will add new empty entries to the vector. More...
 
void resize (int addsize, Keeper *const keeper)
 This will add new empty entries to the vector and inform Keeper of the change. More...
 
void resize (const ModelVariable &mvar, Keeper *const keeper)
 This will add one new entry to the vector and inform Keeper of the change. More...
 
int Size () const
 This will return the size of the vector. More...
 
void read (CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will read the value of the ModelVariable entries from file. More...
 
ModelVariableoperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const ModelVariableoperator[] (int pos) const
 This will return the value of an element of the vector. More...
 
int didChange (const TimeClass *const TimeInfo) const
 This function will check to see if the ModelVariable values have changed. More...
 
void Update (const TimeClass *const TimeInfo)
 This function will update the ModelVariable values. More...
 

Protected Attributes

int size
 This is the size of the vector. More...
 
ModelVariablev
 This is the vector of ModelVariable values. More...
 

Detailed Description

This class implements a dynamic vector of ModelVariable values.

Constructor & Destructor Documentation

◆ ModelVariableVector()

ModelVariableVector::ModelVariableVector ( )
inline

This is the default ModelVariableVector constructor.

◆ ~ModelVariableVector()

ModelVariableVector::~ModelVariableVector ( )

This is the ModelVariableVector destructor.

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

Member Function Documentation

◆ didChange()

int ModelVariableVector::didChange ( const TimeClass *const  TimeInfo) const

This function will check to see if the ModelVariable values have changed.

Parameters
TimeInfois the TimeClass for the current model
Returns
1 if the values have changed, 0 otherwise

◆ operator[]() [1/2]

ModelVariable& ModelVariableVector::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 ModelVariable& ModelVariableVector::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

◆ read()

void ModelVariableVector::read ( CommentStream infile,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This function will read the value of the ModelVariable entries from file.

Parameters
infileis the CommentStream to read the parameters from
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ resize() [1/2]

void ModelVariableVector::resize ( const ModelVariable mvar,
Keeper *const  keeper 
)

This will add one new entry to the vector and inform Keeper of the change.

Parameters
mvaris the new ModelVariable entry to the vector
keeperis the Keeper for the current model

◆ resize() [2/2]

void ModelVariableVector::resize ( int  addsize,
Keeper *const  keeper 
)

This will add new empty entries to the vector and inform Keeper of the change.

Parameters
addsizeis the number of new entries to the vector
keeperis the Keeper for the current model
Note
The new elements of the vector will be created, and set to zero

◆ setsize()

void ModelVariableVector::setsize ( int  addsize)

This will add new empty entries to the vector.

Parameters
addsizeis the number of new entries to the vector
Note
All elements of the vector will be created, and set to zero

◆ Size()

int ModelVariableVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

◆ Update()

void ModelVariableVector::Update ( const TimeClass *const  TimeInfo)

This function will update the ModelVariable values.

Parameters
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ size

int ModelVariableVector::size
protected

This is the size of the vector.

◆ v

ModelVariable* ModelVariableVector::v
protected

This is the vector of ModelVariable values.


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