asge::concurrent
Namespaces
Classes & Structs
Enumerations
enum class ContextErrNilCanceledDeadlineTypedefs
using context_pointer = _internal::IContext::pointerusing thread_pointer = Thread::thread_pointerFunctions
std::string CtxErrStr(ContextErr inErr) noexcepttemplate<typename T> std::shared_ptr< ContextWithValue< T > > WithValue(T inValue, context_pointer inParent)Derives a child context that carries an immutable typed value.
Creates a new ContextWithValue<T> as a child of the given parent, attaching it to the context tree. If the parent is already cancelled at the time of this call, the child is cancelled immediately with the same error. Otherwise the child is registered with the parent and will be cancelled automatically when the parent is.
T | Type of the value to carry. Must be move-constructible. |
inValue | The value to attach to the context. |
inParent | The parent context (nullptr by default). |
context_pointer Background() noexceptReturns the root context of the context tree.
Background is never cancelled, has no deadline, and carries no values. It is intended as the top-level parent for all derived contexts and is the only context that has no parent itself.
The same instance is returned on every call.
Context::pointer WithCancel(context_pointer inParent=nullptr)Derives a child context that can be manually cancelled.
The returned context is a child of the given parent. If the parent is already cancelled at the time of this call, the child is cancelled immediately with the same error. Otherwise, the child is registered with the parent and will be cancelled automatically when the parent is.
If no parent is provided, Background() is used as the parent.
inParent | The parent context. Defaults to Background() if nullptr. |
A shared_ptr<Context> exposing Cancel() directly.
std::size_t HardwareConcurrency() noexcept