3#include <Foundation/Algorithm/HashingUtils.h>
4#include <Foundation/Containers/Map.h>
5#include <Foundation/Strings/String.h>
6#include <Foundation/Threading/AtomicInteger.h>
29#if PL_ENABLED(PL_HASHED_STRING_REF_COUNTING)
39#if PL_ENABLED(PL_HASHED_STRING_REF_COUNTING)
49 static plUInt32 ClearUnusedStrings();
52 PL_DECLARE_MEM_RELOCATABLE_TYPE();
63#if PL_ENABLED(PL_HASHED_STRING_REF_COUNTING)
79 void Assign(
const char (&
string)[N]);
82 void Assign(
char (&
string)[N]) =
delete;
113 const char* GetData()
const;
116 plUInt64 GetHash()
const;
119 bool IsEmpty()
const;
125 PL_ALWAYS_INLINE
operator plStringView()
const {
return GetString().GetView(); }
131 PL_ALWAYS_INLINE
operator const char*()
const {
return GetData(); }
134 static void InitHashedString();
135 static HashedType AddHashedString(
plStringView sString, plUInt64 uiHash);
200 bool IsEmpty()
const;
206 plUInt64 GetHash()
const;
215#include <Foundation/Strings/Implementation/HashedString_inl.h>
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
void Assign(const char(&string)[N])
Assigning a new string from a string constant is a slow operation, but the hash computation can happe...
PL_ALWAYS_INLINE plStringView GetView() const
Returns a string view to this string's data.
Definition HashedString.h:128
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
plTempHashedString(const char(&string)[N])
Creates an plTempHashedString object from the given string constant. The hash can be computed at comp...
void operator=(const char(&string)[N])
The hash of the given string can be computed at compile time.
Definition HashedString.h:28
Forward Iterator to iterate over all elements in sorted order.
Definition Map.h:103
Definition AllocatorWrapper.h:20