netxsimdg
Loading...
Searching...
No Matches
Nextsim::Iterator Class Reference

A class that controls how time steps are performed. More...

#include <Iterator.hpp>

Collaboration diagram for Nextsim::Iterator:
Collaboration graph

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.
 

Detailed Description

A class that controls how time steps are performed.

Definition at line 16 of file Iterator.hpp.

Member Typedef Documentation

◆ Clock

TimePoint::Clock Nextsim::Iterator::Clock

Definition at line 18 of file Iterator.hpp.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

Nextsim::Iterator::Iterator ( )

Definition at line 15 of file Iterator.cpp.

◆ Iterator() [2/2]

Nextsim::Iterator::Iterator ( Iterant * iterant)

Construct a new Iterator given a pointer to an Iterant.

Definition at line 20 of file Iterator.cpp.

Member Function Documentation

◆ parseAndSet()

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.

Parameters
startTimeStrstring to parse for the model start time.
stopTimeStrstring to parse for the model stop time.
durationStrstring to parse for the model run duration.
stepStrstring to parse for the model time step length.

Definition at line 34 of file Iterator.cpp.

Here is the caller graph for this function:

◆ run()

void Nextsim::Iterator::run ( )

Run the Iterant over the specified time period.

Definition at line 54 of file Iterator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIterant()

void Nextsim::Iterator::setIterant ( Iterant * iterant)

Sets the iterant to be iterated using a pointer.

Parameters
iterantThe Iterant that defines a single timestep of the model.

Definition at line 25 of file Iterator.cpp.

◆ setStartDurationStep()

void Nextsim::Iterator::setStartDurationStep ( TimePoint startTime,
Duration duration,
Duration timestep )

Sets the time parameters as a start time, run length and timestep length.

Parameters
startTimeStart time point.
durationMinimum length of the run.
timestepTimestep length.

◆ setStartStopStep()

void Nextsim::Iterator::setStartStopStep ( TimePoint startTime,
TimePoint stopTime,
Duration timestep )

Sets the time parameters as a start time, stop time and timestep length.

Parameters
startTimeStart time point.
stopTimeStop time point.
timestepTimestep length.

Definition at line 27 of file Iterator.cpp.

Member Data Documentation

◆ nullIterant

Iterator::NullIterant Nextsim::Iterator::nullIterant
static

A static instance of the NullIterant class.

Definition at line 119 of file Iterator.hpp.


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