An abstract base class for creating object-oriented coroutines.
More...
#include <base_coroutine.hpp>
|
| virtual | ~BaseCoroutine ()=0 |
| | Pure virtual destructor.
|
| |
| bool | IsDone () const noexcept |
| | Checks if the coroutine has finished its execution.
|
| |
| void | Resume () |
| | Resumes the execution of the coroutine.
|
| |
An abstract base class for creating object-oriented coroutines.
This class provides a way to define coroutines by inheriting from it and implementing the Continuation() method. It wraps the Coroutine class to provide a more object-oriented interface.
◆ ~BaseCoroutine()
| virtual cortex::BaseCoroutine::~BaseCoroutine |
( |
| ) |
|
|
pure virtual |
Pure virtual destructor.
Although it is pure virtual, it must have an implementation in the .cpp file.
◆ BaseCoroutine()
Constructs a new BaseCoroutine.
- Parameters
-
| stack_size_bytes | The size of the stack to allocate for the coroutine (default: 256KB). |
| resource | The memory resource to use for stack and implementation allocation (default: GetDefaultMemoryResource()). |
◆ IsDone()
| bool cortex::BaseCoroutine::IsDone |
( |
| ) |
const |
|
inlinenoexcept |
Checks if the coroutine has finished its execution.
- Returns
- true if execution is complete, false otherwise.
◆ Resume()
| void cortex::BaseCoroutine::Resume |
( |
| ) |
|
|
inline |
Resumes the execution of the coroutine.
If the coroutine was suspended, it continues from the suspension point. Execution will enter or resume in the Continuation() method.
The documentation for this class was generated from the following file: