MayaFlux 0.4.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 330 of file Routine.cpp.

331{
332 if (!m_handle)
333 return false;
334
335 set_state<bool>("restart", true);
336 m_handle.promise().auto_resume = true;
337 if (is_active()) {
338 m_handle.resume();
339 return true;
340 }
341 return false;
342}
bool is_active() const override
Checks if the coroutine is still active.
Definition Routine.cpp:238
std::coroutine_handle< promise_type > m_handle
Handle to the underlying coroutine.
Definition Routine.hpp:623

References is_active(), and m_handle.

+ Here is the call graph for this function: