#include <clock.h>
Public Member Functions | |
CustomClock (std::vector< double > times) | |
Initialises a custom clock with explicitly given output times. More... | |
double | current_time () const override |
double | next_time () const override |
double | timestep_duration () const override |
void | reset (double, bool) override |
reset the clock to the starting time of the simulation More... | |
void | remove_times_in_past (double start_time) override |
Remove all custom times before start_time. More... | |
![]() | |
Clock & | operator++ () |
Advances the clock by one tick. More... | |
Clock & | operator+= (Representation advance_several_timesteps) |
advances the clock by an arbitrary number of ticks. More... | |
bool | operator< (const Clock &rhs) const |
Compares the times between two clocks. More... | |
bool | operator< (double time) const |
Compares the time of the clock against a fixed time. More... | |
bool | operator> (double time) const |
Compares the time of the clock against a fixed time. More... | |
virtual | ~Clock ()=default |
Private Attributes | |
std::vector< double > | custom_times_ |
Vector of times where output is generated. More... | |
Additional Inherited Members | |
![]() | |
using | Representation = std::int64_t |
The type used for counting ticks/time. More... | |
![]() | |
Representation | counter_ = 0 |
Internally used to count the number of time steps. More... | |
|
inline |
Initialises a custom clock with explicitly given output times.
[in] | times | vector of desired output times |
Definition at line 321 of file clock.h.
|
inlineoverridevirtual |
runtime_error | if the clock has never been advanced |
Implements smash::Clock.
Definition at line 329 of file clock.h.
|
inlineoverridevirtual |
Implements smash::Clock.
Definition at line 336 of file clock.h.
|
inlineoverridevirtual |
Implements smash::Clock.
Definition at line 337 of file clock.h.
|
inlineoverridevirtual |
reset the clock to the starting time of the simulation
[in] | start_time | starting time of the imulation |
[in] | is_output_clock | whether this is an output clock rather than a lab clock |
Implements smash::Clock.
Definition at line 340 of file clock.h.
|
inlineoverridevirtual |
Remove all custom times before start_time.
[in] | start_time | starting time of the simulation |
Implements smash::Clock.
Definition at line 347 of file clock.h.
|
private |