Scoped read access to a DocumentState.
More...
#include "donner/svg/DocumentState.h"
|
| | DocumentReadAccess (DocumentState &documentState) |
| | Create a read access guard.
|
|
| DocumentReadAccess (const DocumentReadAccess &other)=delete |
| | Copying access guards is not allowed.
|
|
| DocumentReadAccess (DocumentReadAccess &&other) noexcept |
| | Moving access guards transfers the held access.
|
|
| ~DocumentReadAccess () |
| | Destructor, releasing the held access.
|
|
DocumentReadAccess & | operator= (const DocumentReadAccess &other)=delete |
| | Copying access guards is not allowed.
|
|
DocumentReadAccess & | operator= (DocumentReadAccess &&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.
|
| std::optional< DocumentWriteAccess > | tryUpgrade () |
| | Try to temporarily upgrade this read scope to write access.
|
|
|
class | DocumentWriteAccess |
Scoped read access to a DocumentState.
◆ DocumentReadAccess()
| donner::svg::DocumentReadAccess::DocumentReadAccess |
( |
DocumentState & | documentState | ) |
|
|
inlineexplicit |
Create a read access guard.
- Parameters
-
| documentState | Document state being accessed. |
◆ tryAcquire()
Attempt to create a read access guard without waiting for a writer.
Reentrant access from a thread that already holds read or write access succeeds immediately.
- Parameters
-
| documentState | Document state being accessed. |
- Returns
- A read guard, or std::nullopt while another thread owns or is waiting for write access.
◆ tryUpgrade()
| auto donner::svg::DocumentReadAccess::tryUpgrade |
( |
| ) |
|
|
inlinenodiscard |
Try to temporarily upgrade this read scope to write access.
The returned write guard restores this read access when it is destroyed. In ConcurrentDom mode the conversion succeeds only when this thread owns the document's sole read lock and the writer gate is immediately available. Failure leaves this guard unchanged.
The documentation for this class was generated from the following file: