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

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

#include <timevariablevector.h>

Collaboration diagram for TimeVariableVector:
Collaboration graph

Public Member Functions

 TimeVariableVector ()
 This is the default TimeVariableVector constructor. More...
 
 ~TimeVariableVector ()
 This is the TimeVariableVector 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 TimeVariable &tvar, 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 TimeVariable entries from file. More...
 
TimeVariableoperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const TimeVariableoperator[] (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 TimeVariable values have changed. More...
 
void Update (const TimeClass *const TimeInfo)
 This function will update the TimeVariable values. More...
 

Protected Attributes

int size
 This is the size of the vector. More...
 
TimeVariablev
 This is the vector of TimeVariable values. More...
 

Detailed Description

This class implements a dynamic vector of TimeVariable values.

Constructor & Destructor Documentation

◆ TimeVariableVector()

TimeVariableVector::TimeVariableVector ( )
inline

This is the default TimeVariableVector constructor.

◆ ~TimeVariableVector()

TimeVariableVector::~TimeVariableVector ( )

This is the TimeVariableVector destructor.

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

Member Function Documentation

◆ didChange()

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

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

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

◆ operator[]() [1/2]

TimeVariable& TimeVariableVector::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 TimeVariable& TimeVariableVector::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 TimeVariableVector::read ( CommentStream infile,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This function will read the value of the TimeVariable 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 TimeVariableVector::resize ( const TimeVariable tvar,
Keeper *const  keeper 
)

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

Parameters
tvaris the new TimeVariable entry to the vector
keeperis the Keeper for the current model

◆ resize() [2/2]

void TimeVariableVector::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 TimeVariableVector::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 TimeVariableVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

◆ Update()

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

This function will update the TimeVariable values.

Parameters
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ size

int TimeVariableVector::size
protected

This is the size of the vector.

◆ v

TimeVariable* TimeVariableVector::v
protected

This is the vector of TimeVariable values.


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