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

◆ restart()

bool MayaFlux::Vruta::CrossRoutine::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 552 of file Routine.cpp.

553{
554 if (!m_handle)
555 return false;
556
557 set_state<bool>("restart", true);
558 m_handle.promise().auto_resume = true;
559 if (is_active()) {
560 m_handle.resume();
561 return true;
562 }
563
564 return false;
565}
std::coroutine_handle< promise_type > m_handle
Definition Routine.hpp:752
bool is_active() const override
Checks if the coroutine is still active.
Definition Routine.cpp:441

References is_active(), and m_handle.

+ Here is the call graph for this function: