* the world through Drainable::getState()) could be used to determine
* if all objects have entered the Drained state, the protocol is
* actually a bit more elaborate. See Drainable::drain() for details.
+ *
+ * @ingroup api_drain
*/
enum class DrainState {
Running, /** Running normally */
*
* @return true if all objects were drained successfully, false if
* more simulation is needed.
+ *
+ * @ingroup api_drain
*/
bool tryDrain();
/**
* Resume normal simulation in a Drained system.
+ *
+ * @ingroup api_drain
*/
void resume();
* state since the state isn't stored in checkpoints. This method
* performs state fixups on all Drainable objects and the
* DrainManager itself.
+ *
+ * @ingroup api_drain
*/
void preCheckpointRestore();
- /** Check if the system is drained */
+ /**
+ * Check if the system is drained
+ *
+ * @ingroup api_drain
+ */
bool isDrained() const { return _state == DrainState::Drained; }
- /** Get the simulators global drain state */
+ /**
+ * Get the simulators global drain state
+ *
+ * @ingroup api_drain
+ */
DrainState state() const { return _state; }
/**
* Notify the DrainManager that a Drainable object has finished
* draining.
+ *
+ * @ingroup api_drain
*/
void signalDrainDone();
* @return DrainState::Drained if the object is drained at this
* point in time, DrainState::Draining if it needs further
* simulation.
+ *
+ * @ingroup api_drain
*/
virtual DrainState drain() = 0;
/**
* Resume execution after a successful drain.
+ *
+ * @ingroup api_drain
*/
virtual void drainResume() {};
* into a state where it is ready to be drained. The method is
* safe to call multiple times and there is no need to check that
* draining has been requested before calling this method.
+ *
+ * @ingroup api_drain
*/
void signalDrainDone() const {
switch (_drainState) {
}
public:
- /** Return the current drain state of an object. */
+ /**
+ * Return the current drain state of an object.
+ *
+ * @ingroup api_drain
+ */
DrainState drainState() const { return _drainState; }
/**
*
* This method is only called in the child of the fork. The call
* takes place in a drained system.
+ *
+ * @ingroup api_drain
*/
virtual void notifyFork() {};