Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
BRepGraph::CacheView Class Reference

Non-const view for managing transient cache values on nodes. More...

#include <BRepGraph_CacheView.hxx>

Public Member Functions

void Set (const BRepGraph_NodeId theNode, const occ::handle< BRepGraph_CacheKind > &theKind, const occ::handle< BRepGraph_CacheValue > &theValue)
 Attach a cached value to a node.
 
void Set (const BRepGraph_NodeId theNode, const int theKindSlot, const occ::handle< BRepGraph_CacheValue > &theValue)
 Attach a cached value using a pre-resolved cache-kind slot.
 
occ::handle< BRepGraph_CacheValueGet (const BRepGraph_NodeId theNode, const occ::handle< BRepGraph_CacheKind > &theKind) const
 Retrieve a cached value from a node.
 
occ::handle< BRepGraph_CacheValueGet (const BRepGraph_NodeId theNode, const int theKindSlot) const
 Retrieve a cached value using a pre-resolved cache-kind slot.
 
bool Has (const BRepGraph_NodeId theNode, const occ::handle< BRepGraph_CacheKind > &theKind) const
 Check if a non-stale cached value exists on a node.
 
bool Has (const BRepGraph_NodeId theNode, const int theKindSlot) const
 Check if a non-stale cached value exists using a pre-resolved slot.
 
bool Remove (const BRepGraph_NodeId theNode, const occ::handle< BRepGraph_CacheKind > &theKind)
 Remove a cached value from a node.
 
bool Remove (const BRepGraph_NodeId theNode, const int theKindSlot)
 Remove a cached value using a pre-resolved cache-kind slot.
 
void Invalidate (const BRepGraph_NodeId theNode, const occ::handle< BRepGraph_CacheKind > &theKind)
 Invalidate (but do not remove) a cached value on a node.
 
void Invalidate (const BRepGraph_NodeId theNode, const int theKindSlot)
 Invalidate a cached value using a pre-resolved cache-kind slot.
 
BRepGraph_CacheKindIterator< BRepGraph_NodeIdCacheKindIter (const BRepGraph_NodeId theNode) const
 Create a zero-allocation iterator over all cache kinds populated on a node.
 
BRepGraph_CacheKindIterator< BRepGraph_RefIdCacheKindIter (const BRepGraph_RefId theRef) const
 Create a zero-allocation iterator over all cache kinds populated on a reference.
 
void Set (const BRepGraph_RefId theRef, const occ::handle< BRepGraph_CacheKind > &theKind, const occ::handle< BRepGraph_CacheValue > &theValue)
 Attach a cached value to a reference.
 
void Set (const BRepGraph_RefId theRef, const int theKindSlot, const occ::handle< BRepGraph_CacheValue > &theValue)
 Attach a cached value to a reference using a pre-resolved cache-kind slot.
 
occ::handle< BRepGraph_CacheValueGet (const BRepGraph_RefId theRef, const occ::handle< BRepGraph_CacheKind > &theKind) const
 Retrieve a cached value from a reference.
 
occ::handle< BRepGraph_CacheValueGet (const BRepGraph_RefId theRef, const int theKindSlot) const
 Retrieve a cached value from a reference using a pre-resolved cache-kind slot.
 
bool Has (const BRepGraph_RefId theRef, const occ::handle< BRepGraph_CacheKind > &theKind) const
 Check if a non-stale cached value exists on a reference.
 
bool Has (const BRepGraph_RefId theRef, const int theKindSlot) const
 Check if a non-stale cached value exists on a reference using a pre-resolved slot.
 
bool Remove (const BRepGraph_RefId theRef, const occ::handle< BRepGraph_CacheKind > &theKind)
 Remove a cached value from a reference.
 
bool Remove (const BRepGraph_RefId theRef, const int theKindSlot)
 Remove a cached value from a reference using a pre-resolved cache-kind slot.
 
void Invalidate (const BRepGraph_RefId theRef, const occ::handle< BRepGraph_CacheKind > &theKind)
 Invalidate (but do not remove) a cached value on a reference.
 
void Invalidate (const BRepGraph_RefId theRef, const int theKindSlot)
 Invalidate a cached value on a reference using a pre-resolved cache-kind slot.
 

Detailed Description

Non-const view for managing transient cache values on nodes.

This view is the stable public cache API for BRepGraph callers. External code should use Cache() for all cache access. Low-level storage operations such as reserve or cross-graph cache transfer stay internal to graph-maintenance code through the graph's private cache access.

Cached values are keyed by BRepGraph_CacheKind descriptors (Handle-based) and stored as Handle(BRepGraph_CacheValue). Each CacheKind carries a Standard_GUID for stable identity and is registered in BRepGraph_CacheKindRegistry which maps GUIDs to dense runtime slot indices for O(1) internal storage lookup.

Supports set, get, remove, invalidate, and kind enumeration per node. Cached data is stored centrally in BRepGraph_TransientCache with generation-based freshness tracking via SubtreeGen. Hot-path callers may pre-resolve a cache-kind slot once through BRepGraph_CacheKindRegistry::Register() and then use slot-based overloads to avoid repeated registry locking. Obtained via BRepGraph::Cache().

Member Function Documentation

◆ CacheKindIter() [1/2]

BRepGraph_CacheKindIterator< BRepGraph_NodeId > BRepGraph::CacheView::CacheKindIter ( const BRepGraph_NodeId theNode) const

Create a zero-allocation iterator over all cache kinds populated on a node.

Parameters
[in]theNodenode to query

◆ CacheKindIter() [2/2]

BRepGraph_CacheKindIterator< BRepGraph_RefId > BRepGraph::CacheView::CacheKindIter ( const BRepGraph_RefId theRef) const

Create a zero-allocation iterator over all cache kinds populated on a reference.

Parameters
[in]theRefreference to query

◆ Get() [1/4]

occ::handle< BRepGraph_CacheValue > BRepGraph::CacheView::Get ( const BRepGraph_NodeId theNode,
const int theKindSlot ) const

Retrieve a cached value using a pre-resolved cache-kind slot.

◆ Get() [2/4]

occ::handle< BRepGraph_CacheValue > BRepGraph::CacheView::Get ( const BRepGraph_NodeId theNode,
const occ::handle< BRepGraph_CacheKind > & theKind ) const

Retrieve a cached value from a node.

Parameters
[in]theNodenode to query
[in]theKindcache kind descriptor identifying the slot
Returns
cached value, or null handle if not present or stale

◆ Get() [3/4]

occ::handle< BRepGraph_CacheValue > BRepGraph::CacheView::Get ( const BRepGraph_RefId theRef,
const int theKindSlot ) const

Retrieve a cached value from a reference using a pre-resolved cache-kind slot.

◆ Get() [4/4]

occ::handle< BRepGraph_CacheValue > BRepGraph::CacheView::Get ( const BRepGraph_RefId theRef,
const occ::handle< BRepGraph_CacheKind > & theKind ) const

Retrieve a cached value from a reference.

Returns
cached value, or null handle if not present or stale (OwnGen changed)

◆ Has() [1/4]

bool BRepGraph::CacheView::Has ( const BRepGraph_NodeId theNode,
const int theKindSlot ) const

Check if a non-stale cached value exists using a pre-resolved slot.

◆ Has() [2/4]

bool BRepGraph::CacheView::Has ( const BRepGraph_NodeId theNode,
const occ::handle< BRepGraph_CacheKind > & theKind ) const

Check if a non-stale cached value exists on a node.

Parameters
[in]theNodenode to query
[in]theKindcache kind descriptor identifying the slot
Returns
true if a current value exists for this node and kind

◆ Has() [3/4]

bool BRepGraph::CacheView::Has ( const BRepGraph_RefId theRef,
const int theKindSlot ) const

Check if a non-stale cached value exists on a reference using a pre-resolved slot.

◆ Has() [4/4]

bool BRepGraph::CacheView::Has ( const BRepGraph_RefId theRef,
const occ::handle< BRepGraph_CacheKind > & theKind ) const

Check if a non-stale cached value exists on a reference.

◆ Invalidate() [1/4]

void BRepGraph::CacheView::Invalidate ( const BRepGraph_NodeId theNode,
const int theKindSlot )

Invalidate a cached value using a pre-resolved cache-kind slot.

◆ Invalidate() [2/4]

void BRepGraph::CacheView::Invalidate ( const BRepGraph_NodeId theNode,
const occ::handle< BRepGraph_CacheKind > & theKind )

Invalidate (but do not remove) a cached value on a node.

Parameters
[in]theNodenode whose cache entry to invalidate
[in]theKindcache kind descriptor identifying the slot

◆ Invalidate() [3/4]

void BRepGraph::CacheView::Invalidate ( const BRepGraph_RefId theRef,
const int theKindSlot )

Invalidate a cached value on a reference using a pre-resolved cache-kind slot.

◆ Invalidate() [4/4]

void BRepGraph::CacheView::Invalidate ( const BRepGraph_RefId theRef,
const occ::handle< BRepGraph_CacheKind > & theKind )

Invalidate (but do not remove) a cached value on a reference.

◆ Remove() [1/4]

bool BRepGraph::CacheView::Remove ( const BRepGraph_NodeId theNode,
const int theKindSlot )

Remove a cached value using a pre-resolved cache-kind slot.

◆ Remove() [2/4]

bool BRepGraph::CacheView::Remove ( const BRepGraph_NodeId theNode,
const occ::handle< BRepGraph_CacheKind > & theKind )

Remove a cached value from a node.

Parameters
[in]theNodenode to remove the value from
[in]theKindcache kind descriptor identifying the slot
Returns
true if a value was actually removed

◆ Remove() [3/4]

bool BRepGraph::CacheView::Remove ( const BRepGraph_RefId theRef,
const int theKindSlot )

Remove a cached value from a reference using a pre-resolved cache-kind slot.

◆ Remove() [4/4]

bool BRepGraph::CacheView::Remove ( const BRepGraph_RefId theRef,
const occ::handle< BRepGraph_CacheKind > & theKind )

Remove a cached value from a reference.

Returns
true if a value was actually removed

◆ Set() [1/4]

void BRepGraph::CacheView::Set ( const BRepGraph_NodeId theNode,
const int theKindSlot,
const occ::handle< BRepGraph_CacheValue > & theValue )

Attach a cached value using a pre-resolved cache-kind slot.

◆ Set() [2/4]

void BRepGraph::CacheView::Set ( const BRepGraph_NodeId theNode,
const occ::handle< BRepGraph_CacheKind > & theKind,
const occ::handle< BRepGraph_CacheValue > & theValue )

Attach a cached value to a node.

Parameters
[in]theNodenode to attach the value to
[in]theKindcache kind descriptor identifying the slot
[in]theValuecached value to store

◆ Set() [3/4]

void BRepGraph::CacheView::Set ( const BRepGraph_RefId theRef,
const int theKindSlot,
const occ::handle< BRepGraph_CacheValue > & theValue )

Attach a cached value to a reference using a pre-resolved cache-kind slot.

◆ Set() [4/4]

void BRepGraph::CacheView::Set ( const BRepGraph_RefId theRef,
const occ::handle< BRepGraph_CacheKind > & theKind,
const occ::handle< BRepGraph_CacheValue > & theValue )

Attach a cached value to a reference.

Parameters
[in]theRefreference to attach the value to
[in]theKindcache kind descriptor identifying the slot
[in]theValuecached value to store

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