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

RAII helper that sets the thread-local replay flag for its scope, restoring the previous value on destruction. More...

#include <journal.hpp>

Public Member Functions

 ScopedReplayFlag ()
 Sets the thread-local replay flag to true, saving whatever value was there before.
 ~ScopedReplayFlag ()
 Restores the saved value.
 ScopedReplayFlag (const ScopedReplayFlag &)=delete
ScopedReplayFlag & operator= (const ScopedReplayFlag &)=delete
 ScopedReplayFlag (ScopedReplayFlag &&)=delete
ScopedReplayFlag & operator= (ScopedReplayFlag &&)=delete

Detailed Description

RAII helper that sets the thread-local replay flag for its scope, restoring the previous value on destruction.

Nests correctly: a replay() call that itself triggers another replay() (not a pattern this framework uses today, but not precluded) leaves the flag true for the whole nested extent and restores the outer call's value on the inner guard's destruction – the same nesting behavior session::detail::ScopedContext already has for Context.

Definition at line 187 of file journal.hpp.

Constructor & Destructor Documentation

◆ ScopedReplayFlag()

morph::journal::detail::ScopedReplayFlag::ScopedReplayFlag ( )
inline

Sets the thread-local replay flag to true, saving whatever value was there before.

Definition at line 191 of file journal.hpp.

◆ ~ScopedReplayFlag()

morph::journal::detail::ScopedReplayFlag::~ScopedReplayFlag ( )
inline

Restores the saved value.

Definition at line 193 of file journal.hpp.


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