Class RuntimeContextStorage
Defined in File runtime_context.h
Inheritance Relationships
Derived Type
public opentelemetry::context::ThreadLocalContextStorage
(Class ThreadLocalContextStorage)
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 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()
-
virtual nostd::unique_ptr<Token> Attach(const Context &context) noexcept = 0