Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields
BRepGraph_VersionStamp Struct Reference

Snapshot of an entity/ref identity and version at a point in time. More...

#include <BRepGraph_VersionStamp.hxx>

Public Types

enum class  Domain : uint8_t { None = 0 , Entity = 1 , Ref = 2 }
 Identity domain encoded in this stamp. More...
 

Public Member Functions

 BRepGraph_VersionStamp ()
 Default constructor. Creates an invalid stamp (invalid UID, zero counters).
 
 BRepGraph_VersionStamp (const BRepGraph_UID &theUID, const uint32_t theMutationGen, const uint32_t theGeneration)
 Construct an entity-domain stamp from components.
 
 BRepGraph_VersionStamp (const BRepGraph_RefUID &theRefUID, const uint32_t theMutationGen, const uint32_t theGeneration)
 Construct a reference-domain stamp from components.
 
bool IsValid () const
 Check if the stamp has a valid identity in its domain.
 
bool IsEntityStamp () const
 True when this is an entity-domain stamp.
 
bool IsRefStamp () const
 True when this is a reference-domain stamp.
 
bool operator== (const BRepGraph_VersionStamp &theOther) const
 Full equality: same domain, UID, OwnGen, and Generation. Two invalid stamps are equal.
 
bool operator!= (const BRepGraph_VersionStamp &theOther) const
 
bool IsSameNode (const BRepGraph_VersionStamp &theOther) const
 Check if two stamps refer to the same entity/reference regardless of version. Compares active UID only, ignoring OwnGen and Generation.
 
Standard_GUID ToGUID (const Standard_GUID &theGraphGUID) const
 Derive a deterministic Standard_GUID from this stamp. The graph GUID is incorporated into the hash, making per-node GUIDs globally unique across different graph instances. One-way: cannot reconstruct stamp fields from the resulting GUID.
 
size_t HashValue () const
 Compute hash value consistent with operator==.
 

Data Fields

BRepGraph_UID myUID
 Entity identity for entity-domain stamps.
 
BRepGraph_RefUID myRefUID
 Reference identity for ref-domain stamps.
 
uint32_t myMutationGen
 OwnGen counter at snapshot time (maps to BaseDef::OwnGen / BaseRef::OwnGen).
 
uint32_t myGeneration
 Graph BRepGraph::Clear() generation at snapshot time.
 
Domain myDomain
 Active identity domain.
 

Detailed Description

Snapshot of an entity/ref identity and version at a point in time.

Combines a persistent UID (entity or reference entry) with OwnGen (own-data version counter) and graph Generation (BRepGraph::Clear() cycle). Computed on demand via BRepGraph::UIDs().StampOf().

Usage pattern:

// ... later, after mutations ...
if (aGraph.UIDs().IsStale(aStamp))
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
Snapshot of an entity/ref identity and version at a point in time.
Definition BRepGraph_VersionStamp.hxx:38

Member Enumeration Documentation

◆ Domain

Identity domain encoded in this stamp.

Enumerator
None 
Entity 
Ref 

Constructor & Destructor Documentation

◆ BRepGraph_VersionStamp() [1/3]

BRepGraph_VersionStamp::BRepGraph_VersionStamp ( )
inline

Default constructor. Creates an invalid stamp (invalid UID, zero counters).

◆ BRepGraph_VersionStamp() [2/3]

BRepGraph_VersionStamp::BRepGraph_VersionStamp ( const BRepGraph_UID & theUID,
const uint32_t theMutationGen,
const uint32_t theGeneration )
inline

Construct an entity-domain stamp from components.

Parameters
[in]theUIDpersistent entity identity
[in]theMutationGenOwnGen counter (own-data mutation counter)
[in]theGenerationgraph BRepGraph::Clear() generation

◆ BRepGraph_VersionStamp() [3/3]

BRepGraph_VersionStamp::BRepGraph_VersionStamp ( const BRepGraph_RefUID & theRefUID,
const uint32_t theMutationGen,
const uint32_t theGeneration )
inline

Construct a reference-domain stamp from components.

Parameters
[in]theRefUIDpersistent reference identity
[in]theMutationGenOwnGen counter (own-data mutation counter)
[in]theGenerationgraph BRepGraph::Clear() generation

Member Function Documentation

◆ HashValue()

size_t BRepGraph_VersionStamp::HashValue ( ) const
inline

Compute hash value consistent with operator==.

Returns
hash combining active UID, domain, OwnGen, and Generation

◆ IsEntityStamp()

bool BRepGraph_VersionStamp::IsEntityStamp ( ) const
inline

True when this is an entity-domain stamp.

◆ IsRefStamp()

bool BRepGraph_VersionStamp::IsRefStamp ( ) const
inline

True when this is a reference-domain stamp.

◆ IsSameNode()

bool BRepGraph_VersionStamp::IsSameNode ( const BRepGraph_VersionStamp & theOther) const
inline

Check if two stamps refer to the same entity/reference regardless of version. Compares active UID only, ignoring OwnGen and Generation.

Parameters
[in]theOtherstamp to compare with
Returns
true if both stamps have the same domain and UID

◆ IsValid()

bool BRepGraph_VersionStamp::IsValid ( ) const
inline

Check if the stamp has a valid identity in its domain.

◆ operator!=()

bool BRepGraph_VersionStamp::operator!= ( const BRepGraph_VersionStamp & theOther) const
inline

◆ operator==()

bool BRepGraph_VersionStamp::operator== ( const BRepGraph_VersionStamp & theOther) const
inline

Full equality: same domain, UID, OwnGen, and Generation. Two invalid stamps are equal.

◆ ToGUID()

Standard_GUID BRepGraph_VersionStamp::ToGUID ( const Standard_GUID & theGraphGUID) const

Derive a deterministic Standard_GUID from this stamp. The graph GUID is incorporated into the hash, making per-node GUIDs globally unique across different graph instances. One-way: cannot reconstruct stamp fields from the resulting GUID.

Parameters
[in]theGraphGUIDthe owning graph's identity GUID
Returns
deterministic Standard_GUID derived from stamp + graph GUID

Field Documentation

◆ myDomain

Domain BRepGraph_VersionStamp::myDomain

Active identity domain.

◆ myGeneration

uint32_t BRepGraph_VersionStamp::myGeneration

Graph BRepGraph::Clear() generation at snapshot time.

◆ myMutationGen

uint32_t BRepGraph_VersionStamp::myMutationGen

OwnGen counter at snapshot time (maps to BaseDef::OwnGen / BaseRef::OwnGen).

◆ myRefUID

BRepGraph_RefUID BRepGraph_VersionStamp::myRefUID

Reference identity for ref-domain stamps.

◆ myUID

BRepGraph_UID BRepGraph_VersionStamp::myUID

Entity identity for entity-domain stamps.


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