|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Scoped write access to a DocumentState. More...
#include "donner/svg/DocumentState.h"
Public Member Functions | |
| DocumentWriteAccess (DocumentState &documentState) | |
| Create a write access guard. | |
| DocumentWriteAccess (const DocumentWriteAccess &other)=delete | |
| Copying access guards is not allowed. | |
| DocumentWriteAccess (DocumentWriteAccess &&other) noexcept | |
| Moving access guards transfers the held access. | |
| ~DocumentWriteAccess () | |
| Destructor, releasing the held access. | |
| DocumentWriteAccess & | operator= (const DocumentWriteAccess &other)=delete |
| Copying access guards is not allowed. | |
| DocumentWriteAccess & | operator= (DocumentWriteAccess &&other) noexcept=delete |
| Moving access guards by assignment is not needed by callers. | |
| DocumentState & | documentState () const |
| Get the guarded document state. | |
| Registry & | registry () const |
| Get the guarded registry. | |
| void | bumpMutationRevision () const |
| Mark the guarded document as mutated. | |
| std::optional< DocumentReadAccess > | tryDowngrade () && |
| Try to consume this write guard and atomically downgrade it to read access. | |
Friends | |
| class | DocumentReadAccess |
| class | DocumentState |
Scoped write access to a DocumentState.
|
inlineexplicit |
Create a write access guard.
| documentState | Document state being accessed. |
|
inlinenodiscard |
Try to consume this write guard and atomically downgrade it to read access.
Only an outer guard that directly owns the document's write lock can be downgraded. Failure leaves this guard unchanged, including while a nested read or reentrant write guard is active.