Gadget
timevariablevector.h
Go to the documentation of this file.
1 #ifndef timevariablevector_h
2 #define timevariablevector_h
3 
4 #include "timevariable.h"
5 
11 public:
15  TimeVariableVector() { size = 0; v = 0; };
26  void setsize(int addsize);
33  void resize(int addsize, Keeper* const keeper);
39  void resize(const TimeVariable& tvar, Keeper* const keeper);
44  int Size() const { return size; };
51  void read(CommentStream& infile, const TimeClass* const TimeInfo, Keeper* const keeper);
57  TimeVariable& operator [] (int pos) { return v[pos]; };
63  const TimeVariable& operator [] (int pos) const { return v[pos]; };
69  int didChange(const TimeClass* const TimeInfo) const;
74  void Update(const TimeClass* const TimeInfo);
75 protected:
79  int size;
84 };
85 
86 #endif
This is the class used to strip comments (and whitespace) from any input stream.
Definition: commentstream.h:40
This is the class used to store information about the variables that are used in model simulation.
Definition: keeper.h:17
This is the class used to store information about the timesteps used for the current model.
Definition: areatime.h:87
This class implements a dynamic vector of TimeVariable values.
Definition: timevariablevector.h:10
void Update(const TimeClass *const TimeInfo)
This function will update the TimeVariable values.
Definition: timevariablevector.cc:66
~TimeVariableVector()
This is the TimeVariableVector destructor.
Definition: timevariablevector.cc:35
int size
This is the size of the vector.
Definition: timevariablevector.h:79
TimeVariable * v
This is the vector of TimeVariable values.
Definition: timevariablevector.h:83
void resize(int addsize, Keeper *const keeper)
This will add new empty entries to the vector and inform Keeper of the change.
Definition: timevariablevector.cc:18
void read(CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
This function will read the value of the TimeVariable entries from file.
Definition: timevariablevector.cc:72
void setsize(int addsize)
This will add new empty entries to the vector.
Definition: timevariablevector.cc:6
int Size() const
This will return the size of the vector.
Definition: timevariablevector.h:44
TimeVariableVector()
This is the default TimeVariableVector constructor.
Definition: timevariablevector.h:15
int didChange(const TimeClass *const TimeInfo) const
This function will check to see if the TimeVariable values have changed.
Definition: timevariablevector.cc:57
TimeVariable & operator[](int pos)
This will return the value of an element of the vector.
Definition: timevariablevector.h:57
This is the class used to calculate the value of the time-dependent variables used in the model simul...
Definition: timevariable.h:12