Skip to content

Commit

Permalink
Document observer requirements for state saving
Browse files Browse the repository at this point in the history
  • Loading branch information
kyllingstad committed Nov 25, 2024
1 parent 9f8f643 commit 191a566
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/cosim/observer/observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ class observer
duration lastStepSize,
time_point currentTime) = 0;

/// The simulation was restored to a previously saved state.
/**
* The simulation was restored to a previously saved state.
*
* Note that observers which support this feature must be able to
* reconstruct their internal state using information which is available
* through the `observable` objects they have been given access to. For
* observers where this is not the case, this function should throw
* `cosim::error` with error code `cosim::errc::unsupported_feature`.
*/
virtual void state_restored(step_number currentStep, time_point currentTime) = 0;

virtual ~observer() noexcept { }
Expand Down

0 comments on commit 191a566

Please sign in to comment.