morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::session::detail::ScopedContext Class Reference

RAII helper that sets the thread-local Context for its scope. More...

#include <session.hpp>

Public Member Functions

 ScopedContext (const Context &ctx)
 Installs ctx as the thread-local context until the scope exits.
 ~ScopedContext ()
 Restores the thread-local context that was active at construction.
 ScopedContext (const ScopedContext &)=delete
ScopedContext & operator= (const ScopedContext &)=delete
 ScopedContext (ScopedContext &&)=delete
ScopedContext & operator= (ScopedContext &&)=delete

Detailed Description

RAII helper that sets the thread-local Context for its scope.

Definition at line 315 of file session.hpp.

Constructor & Destructor Documentation

◆ ScopedContext()

morph::session::detail::ScopedContext::ScopedContext ( const Context & ctx)
inlineexplicit

Installs ctx as the thread-local context until the scope exits.

Parameters
ctxContext whose address is stored; must outlive this object.

Definition at line 319 of file session.hpp.

◆ ~ScopedContext()

morph::session::detail::ScopedContext::~ScopedContext ( )
inline

Restores the thread-local context that was active at construction.

Definition at line 321 of file session.hpp.


The documentation for this class was generated from the following file: