![]() |
Open CASCADE Technology Reference Manual 8.0.1
|
RAII scope token batching mutation notifications for a single entity. More...
#include <BRepGraph_MutGuard.hxx>
Public Member Functions | |
| BRepGraph_MutGuard (BRepGraph &theGraph, BRepGraphInc_Storage &theStorage, T *theEntity, const TypeId theId) | |
| Construct a guard over a mutable entity. Registers the item via the storage bit-plane. The Mut() factory pre-validates that no guard is active, so this assertion should never fire in normal use. | |
| ~BRepGraph_MutGuard () | |
Destructor: clears the guard bit-plane and notifies the graph if the guard owns an entity AND at least one setter (or MarkDirty) flagged it modified. Guard clearance happens BEFORE notification so that markModified() propagation does not see a stale guard registration on the same item. | |
| BRepGraph_MutGuard (BRepGraph_MutGuard &&theOther) noexcept | |
| Move constructor: transfers guard ownership. The source becomes inert and will not deregister on its destruction. | |
| BRepGraph_MutGuard & | operator= (BRepGraph_MutGuard &&theOther) noexcept |
| Move assignment: deregisters current guard (if active), then transfers ownership from the source. The source becomes inert. | |
| BRepGraph_MutGuard (const BRepGraph_MutGuard &)=delete | |
| BRepGraph_MutGuard & | operator= (const BRepGraph_MutGuard &)=delete |
| operator bool () const noexcept | |
| True when the guard still owns an entity; false after a move or when constructed in an inert state. | |
| const T * | operator-> () const |
| Read-only access via pointer syntax. Field writes go through the Editor's typed setters. | |
| const T & | operator* () const |
| Read-only dereference. | |
| TypeId | Id () const noexcept |
| Identity for notification. | |
| BRepGraph & | Graph () const |
| Owning graph handle. | |
| void | MarkDirty () noexcept |
Flag the guarded entity as modified without writing through Internal(). Use when an external mutation (e.g. in-place geometry transform on a shared Geom handle) is not visible to the guard. | |
| bool | IsDirty () const noexcept |
True if Internal() or MarkDirty() flagged the entity modified. | |
| T & | Internal () noexcept |
INTERNAL USE ONLY. Mutable accessor; auto-flags dirty. External code MUST go through Editor's typed setters. Use operator->() / operator*() for reads. | |
RAII scope token batching mutation notifications for a single entity.
Obtained via BRepGraph::Editor().<Ops>().Mut() / MutRef() / MutSurface() etc. Reads via operator->() / operator*(); writes via Editor's typed setters (or Internal() for in-tree structural remaps). Any call to Internal() flags the guard dirty and the destructor fires markModified / markRefModified once on scope exit.
The guard registers itself as active on the guarded item at construction and deregisters on destruction. This prevents double-mutation: attempting to acquire a second guard on the same item while the first is still alive will throw. Move-only; after a move, the source guard becomes inert and does not deregister.
Compile-time dispatch selects the ID type and notification method:
|
inline |
Construct a guard over a mutable entity. Registers the item via the storage bit-plane. The Mut() factory pre-validates that no guard is active, so this assertion should never fire in normal use.
| [in] | theGraph | owning graph (used for notification) |
| [in] | theStorage | storage instance (for bit-plane guard tracking) |
| [in] | theEntity | pointer to the mutable entity |
| [in] | theId | identity for notification and guard registration |
|
inline |
Destructor: clears the guard bit-plane and notifies the graph if the guard owns an entity AND at least one setter (or MarkDirty) flagged it modified. Guard clearance happens BEFORE notification so that markModified() propagation does not see a stale guard registration on the same item.
|
inlinenoexcept |
Move constructor: transfers guard ownership. The source becomes inert and will not deregister on its destruction.
|
delete |
|
inline |
Owning graph handle.
|
inlinenoexcept |
Identity for notification.
|
inlinenoexcept |
INTERNAL USE ONLY. Mutable accessor; auto-flags dirty. External code MUST go through Editor's typed setters. Use operator->() / operator*() for reads.
|
inlinenoexcept |
True if Internal() or MarkDirty() flagged the entity modified.
|
inlinenoexcept |
Flag the guarded entity as modified without writing through Internal(). Use when an external mutation (e.g. in-place geometry transform on a shared Geom handle) is not visible to the guard.
|
inlineexplicitnoexcept |
True when the guard still owns an entity; false after a move or when constructed in an inert state.
|
inline |
Read-only dereference.
|
inline |
Read-only access via pointer syntax. Field writes go through the Editor's typed setters.
|
inlinenoexcept |
Move assignment: deregisters current guard (if active), then transfers ownership from the source. The source becomes inert.
|
delete |