Class RuntimeContextStorage

Inheritance Relationships

Derived Type

Class Documentation

class RuntimeContextStorage

RuntimeContextStorage is used by RuntimeContext to store Context frames.

Custom context management strategies can be implemented by deriving from this class and passing an initialized RuntimeContextStorage object to RuntimeContext::SetRuntimeContextStorage.

Subclassed by opentelemetry::context::ThreadLocalContextStorage

Public Functions

virtual Context GetCurrent() noexcept = 0

Return the current context.

Returns

the current context

virtual nostd::unique_ptr<Token> Attach(const Context &context) noexcept = 0

Set the current context.

Parameters

the – new current context

Returns

a token for the new current context. This never returns a nullptr.

virtual bool Detach(Token &token) noexcept = 0

Detach the context related to the given token.

Parameters

token – a token related to a context

Returns

true if the context could be detached

inline virtual ~RuntimeContextStorage()

Protected Functions

inline nostd::unique_ptr<Token> CreateToken(const Context &context) noexcept