A builder class for creating Coroutine instances with custom configuration.
More...
#include <coroutine.hpp>
A builder class for creating Coroutine instances with custom configuration.
The Builder allows setting the stack size and memory resource before constructing the coroutine.
◆ Builder()
| cortex::Coroutine::Builder::Builder |
( |
| ) |
|
Default constructor for Builder.
Initializes with default stack size (256KB) and default memory resource.
◆ Build()
Builds and returns a new Coroutine instance.
- Parameters
-
| body | The function or callable to execute within the coroutine. |
- Returns
- A new Coroutine instance.
- Exceptions
-
| std::invalid_argument | if the body is empty or stack_size_bytes is 0 or resource is null. |
◆ SetMemoryResource()
Sets the memory resource for the coroutine to be built.
- Parameters
-
| resource | The memory resource to use. |
- Returns
- The builder instance for chaining.
◆ SetStackSizeInBytes()
| Builder cortex::Coroutine::Builder::SetStackSizeInBytes |
( |
std::size_t |
stack_size_bytes | ) |
&& |
|
noexcept |
Sets the stack size for the coroutine to be built.
- Parameters
-
| stack_size_bytes | The size of the stack in bytes. |
- Returns
- The builder instance for chaining.
The documentation for this struct was generated from the following file: