netxsimdg
|
A class that controls how time steps are performed. More...
#include <Iterator.hpp>
Classes | |
class | Iterant |
A base class for classes that specify what happens during one timestep. More... | |
class | NullIterant |
A simple Iterant that does nothing. More... | |
Public Types | |
typedef TimePoint::Clock | Clock |
Public Member Functions | |
Iterator (Iterant *iterant) | |
Construct a new Iterator given a pointer to an Iterant. | |
void | setIterant (Iterant *iterant) |
Sets the iterant to be iterated using a pointer. | |
void | setStartStopStep (TimePoint startTime, TimePoint stopTime, Duration timestep) |
Sets the time parameters as a start time, stop time and timestep length. | |
void | setStartDurationStep (TimePoint startTime, Duration duration, Duration timestep) |
Sets the time parameters as a start time, run length and timestep length. | |
TimePoint | parseAndSet (const std::string &startTimeStr, const std::string &stopTimeStr, const std::string &durationStr, const std::string &stepStr) |
Parses the four strings and sets the time parameters from them. | |
void | run () |
Run the Iterant over the specified time period. | |
Static Public Attributes | |
static NullIterant | nullIterant |
A static instance of the NullIterant class. | |
A class that controls how time steps are performed.
Definition at line 16 of file Iterator.hpp.
TimePoint::Clock Nextsim::Iterator::Clock |
Definition at line 18 of file Iterator.hpp.
Nextsim::Iterator::Iterator | ( | ) |
Definition at line 15 of file Iterator.cpp.
Nextsim::Iterator::Iterator | ( | Iterant * | iterant | ) |
Construct a new Iterator given a pointer to an Iterant.
Definition at line 20 of file Iterator.cpp.
TimePoint Nextsim::Iterator::parseAndSet | ( | const std::string & | startTimeStr, |
const std::string & | stopTimeStr, | ||
const std::string & | durationStr, | ||
const std::string & | stepStr ) |
Parses the four strings and sets the time parameters from them.
Give the four strings, the parser determines which ones are valid and can be used. The strings are then parsed to time values and the start time returned, as this can be considered the current time.
startTimeStr | string to parse for the model start time. |
stopTimeStr | string to parse for the model stop time. |
durationStr | string to parse for the model run duration. |
stepStr | string to parse for the model time step length. |
Definition at line 34 of file Iterator.cpp.
void Nextsim::Iterator::run | ( | ) |
Run the Iterant over the specified time period.
Definition at line 54 of file Iterator.cpp.
void Nextsim::Iterator::setIterant | ( | Iterant * | iterant | ) |
Sets the iterant to be iterated using a pointer.
iterant | The Iterant that defines a single timestep of the model. |
Definition at line 25 of file Iterator.cpp.
void Nextsim::Iterator::setStartDurationStep | ( | TimePoint | startTime, |
Duration | duration, | ||
Duration | timestep ) |
Sets the time parameters as a start time, run length and timestep length.
startTime | Start time point. |
duration | Minimum length of the run. |
timestep | Timestep length. |
void Nextsim::Iterator::setStartStopStep | ( | TimePoint | startTime, |
TimePoint | stopTime, | ||
Duration | timestep ) |
Sets the time parameters as a start time, stop time and timestep length.
startTime | Start time point. |
stopTime | Stop time point. |
timestep | Timestep length. |
Definition at line 27 of file Iterator.cpp.
|
static |
A static instance of the NullIterant class.
Definition at line 119 of file Iterator.hpp.