21#ifndef OCCTL_HPP_UID_HPP
22#define OCCTL_HPP_UID_HPP
42 explicit UID(const ::occtl_uid_t theUid) noexcept
55 return myUid.bits != 0;
60 return myUid.bits == theOther.myUid.bits;
65 return myUid.bits != theOther.myUid.bits;
80 explicit RefUID(const ::occtl_ref_uid_t theUid) noexcept
93 static RefUID from_bytes(
const std::array<std::uint8_t, OCCTL_REF_UID_WIRE_SIZE>& theBytes)
101 std::array<std::uint8_t, OCCTL_REF_UID_WIRE_SIZE>
to_bytes()
const
103 std::array<std::uint8_t, OCCTL_REF_UID_WIRE_SIZE> aBytes{};
110 return myUid.
bits != 0;
115 return myUid.
bits == theOther.myUid.bits;
120 return myUid.
bits != theOther.myUid.bits;
135 explicit RepUID(const ::occtl_rep_uid_t theUid) noexcept
148 static RepUID from_bytes(
const std::array<std::uint8_t, OCCTL_REP_UID_WIRE_SIZE>& theBytes)
156 std::array<std::uint8_t, OCCTL_REP_UID_WIRE_SIZE>
to_bytes()
const
158 std::array<std::uint8_t, OCCTL_REP_UID_WIRE_SIZE> aBytes{};
165 return myUid.
bits != 0;
170 return myUid.
bits == theOther.myUid.bits;
175 return myUid.
bits != theOther.myUid.bits;
Persistent identity surviving reference removal and graph compaction.
Definition uid.hpp:77
bool is_valid() const noexcept
True when the UID is not the all-zero sentinel.
Definition uid.hpp:108
static RefUID from_bytes(const std::array< std::uint8_t, OCCTL_REF_UID_WIRE_SIZE > &theBytes)
Decodes a RefUID from the fixed-width C wire format.
Definition uid.hpp:93
bool operator!=(const RefUID &theOther) const noexcept
Bitwise inequality.
Definition uid.hpp:118
static RefUID invalid() noexcept
Returns the invalid sentinel (all-zero bits).
Definition uid.hpp:86
std::array< std::uint8_t, OCCTL_REF_UID_WIRE_SIZE > to_bytes() const
Encodes this RefUID into the fixed-width C wire format.
Definition uid.hpp:101
bool operator==(const RefUID &theOther) const noexcept
Bitwise equality.
Definition uid.hpp:113
RefUID(const ::occtl_ref_uid_t theUid) noexcept
Wraps an existing C value type (zero-cost).
Definition uid.hpp:80
::occtl_ref_uid_t get() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition uid.hpp:89
Persistent identity surviving representation removal and graph compaction.
Definition uid.hpp:132
::occtl_rep_uid_t get() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition uid.hpp:144
static RepUID from_bytes(const std::array< std::uint8_t, OCCTL_REP_UID_WIRE_SIZE > &theBytes)
Decodes a RepUID from the fixed-width C wire format.
Definition uid.hpp:148
std::array< std::uint8_t, OCCTL_REP_UID_WIRE_SIZE > to_bytes() const
Encodes this RepUID into the fixed-width C wire format.
Definition uid.hpp:156
bool is_valid() const noexcept
True when the UID is not the all-zero sentinel.
Definition uid.hpp:163
bool operator==(const RepUID &theOther) const noexcept
Bitwise equality.
Definition uid.hpp:168
static RepUID invalid() noexcept
Returns the invalid sentinel (all-zero bits).
Definition uid.hpp:141
RepUID(const ::occtl_rep_uid_t theUid) noexcept
Wraps an existing C value type (zero-cost).
Definition uid.hpp:135
bool operator!=(const RepUID &theOther) const noexcept
Bitwise inequality.
Definition uid.hpp:173
Persistent identity surviving node removal and graph compaction. Mirrors occtl_uid_t.
Definition uid.hpp:39
UID(const ::occtl_uid_t theUid) noexcept
Wraps an existing C value type (zero-cost).
Definition uid.hpp:42
static UID invalid() noexcept
Returns the invalid sentinel (all-zero bits).
Definition uid.hpp:48
bool operator==(const UID &theOther) const noexcept
Bitwise equality.
Definition uid.hpp:58
::occtl_uid_t get() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition uid.hpp:51
bool is_valid() const noexcept
True when the UID is not the all-zero sentinel.
Definition uid.hpp:53
bool operator!=(const UID &theOther) const noexcept
Bitwise inequality.
Definition uid.hpp:63
C++ veneer for the core module.
void check(const ::occtl_status_t theStatus)
Throw on non-OK; otherwise a no-op.
Definition core.hpp:85
#define OCCTL_UID_INVALID
Definition occtl_core.h:286
OCCT-Light: topology module public API.
occtl_status_t occtl_rep_uid_to_bytes(occtl_rep_uid_t rep_uid, uint8_t *out_bytes)
occtl_status_t occtl_ref_uid_from_bytes(const uint8_t *in_bytes, occtl_ref_uid_t *out_ref_uid)
occtl_status_t occtl_rep_uid_from_bytes(const uint8_t *in_bytes, occtl_rep_uid_t *out_rep_uid)
occtl_status_t occtl_ref_uid_to_bytes(occtl_ref_uid_t ref_uid, uint8_t *out_bytes)
Definition occtl_topo_types.h:76
uint64_t bits
Definition occtl_topo_types.h:77
Definition occtl_topo_types.h:91
uint64_t bits
Definition occtl_topo_types.h:92
Definition occtl_core.h:272