Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
BRepGraph_NodeId::Typed< TheKind > Struct Template Reference

Compile-time typed wrapper around BRepGraph_NodeId. More...

#include <BRepGraph_NodeId.hxx>

Public Member Functions

 Typed ()
 Default: invalid (Index = UINT32_MAX).
 Typed (const uint32_t theIdx)
 Construct from index.
 Typed (const BRepGraph_NodeId theId)
 Construct from an untyped node id of the same kind.
template<Kind OtherKind, typename std::enable_if_t< OtherKind !=TheKind, int > = 0>
 Typed (const Typed< OtherKind > &)=delete
bool IsValid () const
 True if this id points to an allocated node slot.
bool IsValid (const uint32_t theMaxCount) const
 True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.
template<typename CountProviderT>
auto IsValidIn (const CountProviderT &theProvider) const -> decltype(theProvider.Nb(), bool())
 True if this id is within the dense range exposed by a provider with Nb().
template<typename CountProviderT>
auto IsValidIn (const CountProviderT &theProvider) const -> decltype(theProvider.Size(), bool())
 True if this id is within the dense range exposed by a provider with Size().
 operator BRepGraph_NodeId () const
 Implicit conversion to untyped NodeId.
bool operator== (const Typed &theOther) const
bool operator!= (const Typed &theOther) const
bool operator< (const Typed &theOther) const
bool operator<= (const Typed &theOther) const
bool operator> (const Typed &theOther) const
bool operator>= (const Typed &theOther) const
Typed & operator++ ()
 Pre-increment (++id).
Typed operator++ (int)
 Post-increment (id++).
Typed operator+ (const uint32_t theOffset) const
 Advance by offset.
Typed operator- (const uint32_t theOffset) const
 Retreat by offset.
bool operator== (const BRepGraph_NodeId &theOther) const
 Comparison with untyped NodeId (checks both Kind and Index).
bool operator!= (const BRepGraph_NodeId &theOther) const
bool IsRemoved (const BRepGraph &theGraph) const
 Return true if this node has been soft-removed in the given graph.
bool IsOwned (const BRepGraph &theGraph) const
 Return true if this node has an active owner in the given graph.

Static Public Member Functions

static Typed Start ()
 First valid id in a dense per-kind sequence.
static Typed Invalid ()
 Invalid sentinel id.
static Typed FromNodeId (const BRepGraph_NodeId theId)
 Explicit conversion from untyped NodeId. Asserts that the Kind matches in debug builds.

Data Fields

uint32_t Index

Static Public Attributes

static constexpr uint32_t THE_START_INDEX = 0u
static constexpr uint32_t THE_INVALID_INDEX = std::numeric_limits<uint32_t>::max()

Detailed Description

template<Kind TheKind>
struct BRepGraph_NodeId::Typed< TheKind >

Compile-time typed wrapper around BRepGraph_NodeId.

Provides compile-time kind safety: a Typed<Kind::Face> cannot be accidentally used where a Typed<Kind::Edge> is expected. Implicitly converts to BRepGraph_NodeId for API continuity.

Template Parameters
TheKindthe BRepGraph_NodeId::Kind this typed id represents

Constructor & Destructor Documentation

◆ Typed() [1/4]

template<Kind TheKind>
BRepGraph_NodeId::Typed< TheKind >::Typed ( )
inline

Default: invalid (Index = UINT32_MAX).

◆ Typed() [2/4]

template<Kind TheKind>
BRepGraph_NodeId::Typed< TheKind >::Typed ( const uint32_t theIdx)
inlineexplicit

Construct from index.

◆ Typed() [3/4]

template<Kind TheKind>
BRepGraph_NodeId::Typed< TheKind >::Typed ( const BRepGraph_NodeId theId)
inlineexplicit

Construct from an untyped node id of the same kind.

◆ Typed() [4/4]

template<Kind TheKind>
template<Kind OtherKind, typename std::enable_if_t< OtherKind !=TheKind, int > = 0>
BRepGraph_NodeId::Typed< TheKind >::Typed ( const Typed< OtherKind > & )
delete

Member Function Documentation

◆ FromNodeId()

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::FromNodeId ( const BRepGraph_NodeId theId)
inlinestatic

Explicit conversion from untyped NodeId. Asserts that the Kind matches in debug builds.

Parameters
[in]theIduntyped NodeId to convert

◆ Invalid()

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::Invalid ( )
inlinestaticnodiscard

Invalid sentinel id.

◆ IsOwned()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::IsOwned ( const BRepGraph & theGraph) const
inlinenodiscard

Return true if this node has an active owner in the given graph.

◆ IsRemoved()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::IsRemoved ( const BRepGraph & theGraph) const
inlinenodiscard

Return true if this node has been soft-removed in the given graph.

◆ IsValid() [1/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::IsValid ( ) const
inlinenodiscard

True if this id points to an allocated node slot.

◆ IsValid() [2/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::IsValid ( const uint32_t theMaxCount) const
inlinenodiscard

True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.

◆ IsValidIn() [1/2]

template<Kind TheKind>
template<typename CountProviderT>
auto BRepGraph_NodeId::Typed< TheKind >::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Nb(), bool())
inlinenodiscard

True if this id is within the dense range exposed by a provider with Nb().

◆ IsValidIn() [2/2]

template<Kind TheKind>
template<typename CountProviderT>
auto BRepGraph_NodeId::Typed< TheKind >::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Size(), bool())
inlinenodiscard

True if this id is within the dense range exposed by a provider with Size().

◆ operator BRepGraph_NodeId()

template<Kind TheKind>
BRepGraph_NodeId::Typed< TheKind >::operator BRepGraph_NodeId ( ) const
inline

Implicit conversion to untyped NodeId.

◆ operator!=() [1/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator!= ( const BRepGraph_NodeId & theOther) const
inline

◆ operator!=() [2/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator!= ( const Typed< TheKind > & theOther) const
inline

◆ operator+()

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::operator+ ( const uint32_t theOffset) const
inlinenodiscard

Advance by offset.

◆ operator++() [1/2]

template<Kind TheKind>
Typed & BRepGraph_NodeId::Typed< TheKind >::operator++ ( )
inline

Pre-increment (++id).

◆ operator++() [2/2]

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::operator++ ( int )
inline

Post-increment (id++).

◆ operator-()

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::operator- ( const uint32_t theOffset) const
inlinenodiscard

Retreat by offset.

◆ operator<()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator< ( const Typed< TheKind > & theOther) const
inline

◆ operator<=()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator<= ( const Typed< TheKind > & theOther) const
inline

◆ operator==() [1/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator== ( const BRepGraph_NodeId & theOther) const
inline

Comparison with untyped NodeId (checks both Kind and Index).

◆ operator==() [2/2]

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator== ( const Typed< TheKind > & theOther) const
inline

◆ operator>()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator> ( const Typed< TheKind > & theOther) const
inline

◆ operator>=()

template<Kind TheKind>
bool BRepGraph_NodeId::Typed< TheKind >::operator>= ( const Typed< TheKind > & theOther) const
inline

◆ Start()

template<Kind TheKind>
Typed BRepGraph_NodeId::Typed< TheKind >::Start ( )
inlinestaticnodiscard

First valid id in a dense per-kind sequence.

Field Documentation

◆ Index

template<Kind TheKind>
uint32_t BRepGraph_NodeId::Typed< TheKind >::Index

◆ THE_INVALID_INDEX

template<Kind TheKind>
uint32_t BRepGraph_NodeId::Typed< TheKind >::THE_INVALID_INDEX = std::numeric_limits<uint32_t>::max()
staticconstexpr

◆ THE_START_INDEX

template<Kind TheKind>
uint32_t BRepGraph_NodeId::Typed< TheKind >::THE_START_INDEX = 0u
staticconstexpr

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