Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
BRepGraph_MutGuard< T > Class Template Reference

RAII scope token batching mutation notifications for a single entity. More...

#include <BRepGraph_MutGuard.hxx>

Public Member Functions

 BRepGraph_MutGuard (BRepGraph *theGraph, T *theEntity, const TypeId theId)
 Construct a guard over a mutable entity.
 
 ~BRepGraph_MutGuard ()
 Destructor: notifies the graph if the guard owns an entity AND at least one setter (or MarkDirty) flagged it modified.
 
 BRepGraph_MutGuard (BRepGraph_MutGuard &&theOther) noexcept
 
BRepGraph_MutGuardoperator= (BRepGraph_MutGuard &&theOther) noexcept
 
 BRepGraph_MutGuard (const BRepGraph_MutGuard &)=delete
 
BRepGraph_MutGuardoperator= (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.
 
BRepGraphGraph () const noexcept
 Owning graph pointer (nullptr after move).
 
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.
 

Detailed Description

template<typename T>
class BRepGraph_MutGuard< T >

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 / markRepModified once on scope exit.

Move-only; non-copyable. After a move, the source guard becomes inert.

Compile-time dispatch selects the ID type and notification method:

{
theGraph.Editor().Edges().Mut(BRepGraph_EdgeId(42));
theGraph.Editor().Edges().SetTolerance (anEdge, 0.5);
theGraph.Editor().Edges().SetSameParameter (anEdge, true);
} // markModified called once here
BRepGraph_NodeId::Typed< BRepGraph_NodeId::Kind::Edge > BRepGraph_EdgeId
Definition BRepGraph_NodeId.hxx:350
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

Constructor & Destructor Documentation

◆ BRepGraph_MutGuard() [1/3]

template<typename T >
BRepGraph_MutGuard< T >::BRepGraph_MutGuard ( BRepGraph * theGraph,
T * theEntity,
const TypeId theId )
inline

Construct a guard over a mutable entity.

Parameters
[in]theGraphowning graph (used for notification on destruction)
[in]theEntitypointer to the mutable entity
[in]theIdidentity for notification

◆ ~BRepGraph_MutGuard()

template<typename T >
BRepGraph_MutGuard< T >::~BRepGraph_MutGuard ( )
inline

Destructor: notifies the graph if the guard owns an entity AND at least one setter (or MarkDirty) flagged it modified.

◆ BRepGraph_MutGuard() [2/3]

template<typename T >
BRepGraph_MutGuard< T >::BRepGraph_MutGuard ( BRepGraph_MutGuard< T > && theOther)
inlinenoexcept

◆ BRepGraph_MutGuard() [3/3]

template<typename T >
BRepGraph_MutGuard< T >::BRepGraph_MutGuard ( const BRepGraph_MutGuard< T > & )
delete

Member Function Documentation

◆ Graph()

template<typename T >
BRepGraph * BRepGraph_MutGuard< T >::Graph ( ) const
inlinenoexcept

Owning graph pointer (nullptr after move).

◆ Id()

template<typename T >
TypeId BRepGraph_MutGuard< T >::Id ( ) const
inlinenoexcept

Identity for notification.

◆ Internal()

template<typename T >
T & BRepGraph_MutGuard< T >::Internal ( )
inlinenoexcept

INTERNAL USE ONLY. Mutable accessor; auto-flags dirty. External code MUST go through Editor's typed setters. Use operator->() / operator*() for reads.

◆ IsDirty()

template<typename T >
bool BRepGraph_MutGuard< T >::IsDirty ( ) const
inlinenoexcept

True if Internal() or MarkDirty() flagged the entity modified.

◆ MarkDirty()

template<typename T >
void BRepGraph_MutGuard< T >::MarkDirty ( )
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.

◆ operator bool()

template<typename T >
BRepGraph_MutGuard< T >::operator bool ( ) const
inlineexplicitnoexcept

True when the guard still owns an entity; false after a move or when constructed in an inert state.

◆ operator*()

template<typename T >
const T & BRepGraph_MutGuard< T >::operator* ( ) const
inline

Read-only dereference.

◆ operator->()

template<typename T >
const T * BRepGraph_MutGuard< T >::operator-> ( ) const
inline

Read-only access via pointer syntax. Field writes go through the Editor's typed setters.

◆ operator=() [1/2]

template<typename T >
BRepGraph_MutGuard & BRepGraph_MutGuard< T >::operator= ( BRepGraph_MutGuard< T > && theOther)
inlinenoexcept

◆ operator=() [2/2]

template<typename T >
BRepGraph_MutGuard & BRepGraph_MutGuard< T >::operator= ( const BRepGraph_MutGuard< T > & )
delete

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