Skip to main content

hash Struct Template

Hash specialization for RuntimeHandle. More...

Declaration

template <typename StrongIdentifier, typename RuntimeId> struct std::hash<helios::core::data::RuntimeHandle< StrongIdentifier, RuntimeId >> { ... }

Public Operators Index

template <typename StrongIdentifier, typename RuntimeId>
std::size_toperator() (const helios::core::data::RuntimeHandle< StrongIdentifier, RuntimeId > &handle) const noexcept

Description

Hash specialization for RuntimeHandle.

Packs `strongId` and `runtimeId` into a single 64-bit value before hashing, assuming both underlying types are `uint32_t`.

Template Parameters
StrongIdentifier

The compile-time identifier type.

RuntimeId

The runtime index type.

Definition at line 73 of file RuntimeHandle.ixx.

Public Operators

operator()()

template <typename StrongIdentifier, typename RuntimeId>
std::size_t std::hash< helios::core::data::RuntimeHandle< StrongIdentifier, RuntimeId > >::operator() (const helios::core::data::RuntimeHandle< StrongIdentifier, RuntimeId > & handle)
inline noexcept

Definition at line 74 of file RuntimeHandle.ixx.

75
76 static_assert(std::is_same_v<helios::core::types::StrongId_t, uint32_t>);
77 static_assert(std::is_same_v<RuntimeId, uint32_t>);
78
79 const uint64_t packed = (static_cast<uint64_t>(handle.strongId.value()) << 32) |
80 static_cast<uint64_t>(handle.runtimeId);
81
82 return std::hash<uint64_t>{}(packed);
83 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.