HashValue Struct Reference

#include <apibase.h>

Detailed Description

HashValue is used as return type of GetHashValue functions. It has a size of 128 bits. For reasonable hash value functions it's a practically safe assumption that there are no hash collisions.

Public Member Functions

 HashValue ()=default
 
constexpr HashValue (UInt64 l, UInt64 h)
 
 MAXON_OPERATOR_EQUALITY_HASHCODE (HashValue, low, high)
 
Bool operator< (const HashValue &other) const
 
 MAXON_OPERATOR_INEQUALITY (HashValue)
 
constexpr UInt operator& (UInt mask) const
 
void CombineUnordered (const HashValue &other)
 

Public Attributes

UInt64 low
 
UInt64 high
 

Constructor & Destructor Documentation

◆ HashValue() [1/2]

HashValue ( )
default

◆ HashValue() [2/2]

constexpr HashValue ( UInt64  l,
UInt64  h 
)
constexpr

Member Function Documentation

◆ MAXON_OPERATOR_EQUALITY_HASHCODE()

MAXON_OPERATOR_EQUALITY_HASHCODE ( HashValue  ,
low  ,
high   
)

◆ operator<()

Bool operator< ( const HashValue other) const

◆ MAXON_OPERATOR_INEQUALITY()

MAXON_OPERATOR_INEQUALITY ( HashValue  )

◆ operator&()

constexpr UInt operator& ( UInt  mask) const
constexpr

Returns the bitwise and of the low bits of this HashValue and the given mask.

Parameters
[in]maskA bit mask.
Returns
Bitwise and of low bits and mask.

◆ CombineUnordered()

void CombineUnordered ( const HashValue other)

Combines the other HashValue with this HashValue in an unordered way, which means that the effect of multiple calls to CombineUnordered doesn't depend on the order of those calls. You can use this function to compute a HashValue of a sequence of HashValues when the sequence order shall be irrelevant.

Parameters
[in]otherAnother HashValue.

Member Data Documentation

◆ low

UInt64 low

The lower 64 bits of the HashValue.

◆ high

UInt64 high

The higher 64 bits of the HashValue.