Gadget
modelvariablevector.h
Go to the documentation of this file.
1 #ifndef modelvariablevector_h
2 #define modelvariablevector_h
3 
4 #include "modelvariable.h"
5 
11 public:
15  ModelVariableVector() { size = 0; v = 0; };
26  void setsize(int addsize);
33  void resize(int addsize, Keeper* const keeper);
39  void resize(const ModelVariable& mvar, Keeper* const keeper);
44  int Size() const { return size; };
51  void read(CommentStream& infile, const TimeClass* const TimeInfo, Keeper* const keeper);
57  ModelVariable& operator [] (int pos) { return v[pos]; };
63  const ModelVariable& 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 class implements a dynamic vector of ModelVariable values.
Definition: modelvariablevector.h:10
void read(CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
This function will read the value of the ModelVariable entries from file.
Definition: modelvariablevector.cc:72
void setsize(int addsize)
This will add new empty entries to the vector.
Definition: modelvariablevector.cc:6
ModelVariableVector()
This is the default ModelVariableVector constructor.
Definition: modelvariablevector.h:15
ModelVariable * v
This is the vector of ModelVariable values.
Definition: modelvariablevector.h:83
int Size() const
This will return the size of the vector.
Definition: modelvariablevector.h:44
void Update(const TimeClass *const TimeInfo)
This function will update the ModelVariable values.
Definition: modelvariablevector.cc:66
ModelVariable & operator[](int pos)
This will return the value of an element of the vector.
Definition: modelvariablevector.h:57
void resize(int addsize, Keeper *const keeper)
This will add new empty entries to the vector and inform Keeper of the change.
Definition: modelvariablevector.cc:18
int didChange(const TimeClass *const TimeInfo) const
This function will check to see if the ModelVariable values have changed.
Definition: modelvariablevector.cc:57
~ModelVariableVector()
This is the ModelVariableVector destructor.
Definition: modelvariablevector.cc:35
int size
This is the size of the vector.
Definition: modelvariablevector.h:79
This is the base class used to calculate the value of variables used in the model simulation that are...
Definition: modelvariable.h:19
This is the class used to store information about the timesteps used for the current model.
Definition: areatime.h:87