MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ restart()

bool MayaFlux::Vruta::GraphicsRoutine::restart ( )
overridevirtual

Restarts the coroutine from the beginning.

Returns
True if restart succeeded, false otherwise

Resets the coroutine to its initial state and prepares it for execution from the beginning. This allows reusing the same coroutine logic multiple times without creating a new coroutine.

Implements MayaFlux::Vruta::Routine.

Definition at line 363 of file Routine.cpp.

364{
365 if (!m_handle)
366 return false;
367
368 set_state<bool>("restart", true);
369 m_handle.promise().auto_resume = true;
370 if (is_active()) {
371 m_handle.resume();
372 return true;
373 }
374 return false;
375}
bool is_active() const override
Checks if the coroutine is still active.
Definition Routine.cpp:269
std::coroutine_handle< promise_type > m_handle
Handle to the underlying coroutine.
Definition Routine.hpp:654

References is_active(), and m_handle.

+ Here is the call graph for this function: