ezEngine  Release 25.03
ezTempHashedString Class Reference

A class to use together with ezHashedString for quick comparisons with temporary strings that need not be stored further. More...

#include <HashedString.h>

Public Member Functions

template<size_t N>
 ezTempHashedString (const char(&string)[N])
 Creates an ezTempHashedString object from the given string constant. The hash can be computed at compile time.
 
template<size_t N>
 ezTempHashedString (char(&string)[N])=delete
 
 ezTempHashedString (ezStringView sString)
 Creates an ezTempHashedString object from the given string. Computes the hash of the given string during runtime, which might be slow.
 
 ezTempHashedString (const ezTempHashedString &rhs)
 Copies the hash from rhs.
 
 ezTempHashedString (const ezHashedString &rhs)
 Copies the hash from the ezHashedString.
 
 ezTempHashedString (ezUInt32 uiHash)=delete
 
 ezTempHashedString (ezUInt64 uiHash)
 Copies the hash from the 64 bit integer.
 
template<size_t N>
void operator= (const char(&string)[N])
 The hash of the given string can be computed at compile time.
 
void operator= (ezStringView sString)
 Computes and stores the hash of the given string during runtime, which might be slow.
 
void operator= (const ezTempHashedString &rhs)
 Copies the hash from rhs.
 
void operator= (const ezHashedString &rhs)
 Copies the hash from the ezHashedString.
 
bool operator== (const ezTempHashedString &rhs) const
 Compares the two objects by their hash value. Might report incorrect equality, if two strings have the same hash value.
 
 EZ_ADD_DEFAULT_OPERATOR_NOTEQUAL (const ezTempHashedString &)
 
bool operator< (const ezTempHashedString &rhs) const
 This operator allows soring objects by hash value, not by alphabetical order.
 
bool IsEmpty () const
 Checks whether the ezTempHashedString represents the empty string.
 
void Clear ()
 Resets the string to the empty string.
 
ezUInt64 GetHash () const
 Returns the hash of the stored string.
 
ezResult LookupStringHash (ezStringView &out_sResult) const
 Convenience function to call ezHashedString::LookupStringHash().
 
template<size_t N>
EZ_ALWAYS_INLINE ezTempHashedString (const char(&string)[N])
 
template<size_t N>
EZ_ALWAYS_INLINE void operator= (const char(&string)[N])
 

Friends

class ezHashedString
 

Detailed Description

A class to use together with ezHashedString for quick comparisons with temporary strings that need not be stored further.

Whenever you have objects that use ezHashedString members and you need to compare against them with some temporary string, prefer to use ezTempHashedString instead of ezHashedString, as the latter requires thread synchronization to actually set up the object.


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