process: make pause/unpause public - see #1257

This commit is contained in:
skypjack
2025-06-04 19:04:56 +02:00
parent 62e05abc77
commit df5e57f381

View File

@@ -134,20 +134,6 @@ protected:
}
}
/*! @brief Stops a process if it's running, otherwise does nothing. */
void pause() noexcept {
if(current == state::running) {
current = state::paused;
}
}
/*! @brief Restarts a process if it's paused, otherwise does nothing. */
void unpause() noexcept {
if(current == state::paused) {
current = state::running;
}
}
public:
/*! @brief Type used to provide elapsed time. */
using delta_type = Delta;
@@ -192,6 +178,20 @@ public:
}
}
/*! @brief Stops a process if it's running, otherwise does nothing. */
void pause() noexcept {
if(current == state::running) {
current = state::paused;
}
}
/*! @brief Restarts a process if it's paused, otherwise does nothing. */
void unpause() noexcept {
if(current == state::paused) {
current = state::running;
}
}
/**
* @brief Returns true if a process is either running or paused.
* @return True if the process is still alive, false otherwise.