ezEngine  Milestone 9
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(&szString)[N])
 Creates an ezTempHashedString object from the given string constant. The hash can be computed at compile time.
 
 ezTempHashedString (ezHashingUtils::StringWrapper szString)
 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)
 Copies the hash from the integer.
 
template<size_t N>
void operator= (const char(&szString)[N])
 The hash of the given string can be computed at compile time.
 
void operator= (ezHashingUtils::StringWrapper szString)
 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.
 
bool operator!= (const ezTempHashedString &rhs) const
 
bool operator< (const ezTempHashedString &rhs) const
 This operator allows soring objects by hash value, not by alphabetical order.
 
ezUInt32 GetHash () const
 Returns the hash of the stored string.
 
template<size_t N>
EZ_ALWAYS_INLINE ezTempHashedString (const char(&szString)[N])
 
template<size_t N>
EZ_ALWAYS_INLINE void operator= (const char(&szString)[N])
 
template<size_t N>
EZ_ALWAYS_INLINE constexpr ezUInt32 ComputeHash (const char(&szString)[N])
 

Static Public Member Functions

template<size_t N>
static constexpr ezUInt32 ComputeHash (const char(&szString)[N])
 
static ezUInt32 ComputeHash (ezHashingUtils::StringWrapper szString)
 

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.

Member Function Documentation

◆ operator!=()

EZ_ALWAYS_INLINE bool ezTempHashedString::operator!= ( const ezTempHashedString rhs) const
See also
operator==

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