Plasma Engine  2.0
Loading...
Searching...
No Matches
plTempHashedString Class Reference

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

#include <HashedString.h>

Public Member Functions

template<size_t N>
 plTempHashedString (const char(&string)[N])
 Creates an plTempHashedString object from the given string constant. The hash can be computed at compile time.
 
template<size_t N>
 plTempHashedString (char(&string)[N])=delete
 
 plTempHashedString (plStringView sString)
 Creates an plTempHashedString object from the given string. Computes the hash of the given string during runtime, which might be slow.
 
 plTempHashedString (const plTempHashedString &rhs)
 Copies the hash from rhs.
 
 plTempHashedString (const plHashedString &rhs)
 Copies the hash from the plHashedString.
 
 plTempHashedString (plUInt32 uiHash)=delete
 
 plTempHashedString (plUInt64 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= (plStringView sString)
 Computes and stores the hash of the given string during runtime, which might be slow.
 
void operator= (const plTempHashedString &rhs)
 Copies the hash from rhs.
 
void operator= (const plHashedString &rhs)
 Copies the hash from the plHashedString.
 
bool operator== (const plTempHashedString &rhs) const
 Compares the two objects by their hash value. Might report incorrect equality, if two strings have the same hash value.
 
 PL_ADD_DEFAULT_OPERATOR_NOTEQUAL (const plTempHashedString &)
 
bool operator< (const plTempHashedString &rhs) const
 This operator allows soring objects by hash value, not by alphabetical order.
 
bool IsEmpty () const
 Checks whether the plTempHashedString represents the empty string.
 
void Clear ()
 Resets the string to the empty string.
 
plUInt64 GetHash () const
 Returns the hash of the stored string.
 
template<size_t N>
PL_ALWAYS_INLINE plTempHashedString (const char(&string)[N])
 
template<size_t N>
PL_ALWAYS_INLINE void operator= (const char(&string)[N])
 

Friends

class plHashedString
 

Detailed Description

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

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


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