Isle
|
[AI] Atomized (unique) string identifier, managed by reference counting. More...
#include <mxatom.h>
Public Member Functions | |
MxAtomId (const char *, LookupMode) | |
[AI] Constructs an atom ID for the given string and lookup mode, increments atom reference count. More... | |
~MxAtomId () | |
[AI] Destructor for atom ID. More... | |
MxAtomId & | operator= (const MxAtomId &p_atomId) |
[AI] Copy assignment operator. More... | |
MxBool | operator== (const MxAtomId &p_atomId) const |
[AI] Tests for equality with another atom ID based on the internal string pointer. More... | |
MxBool | operator== (const char *p_internal) const |
[AI] Tests equality against a raw string, using a direct string comparison. More... | |
MxAtomId () | |
[AI] Constructs a null/empty atom ID. More... | |
void | Clear () |
[AI] Disassociates the atom ID from any atom (decrements reference count, sets internal pointer to NULL). More... | |
const char * | GetInternal () const |
[AI] Returns a pointer to the internal string, or nullptr if not set. More... | |
[AI] Atomized (unique) string identifier, managed by reference counting.
MxAtomId refers to a unique key in the global atom set, and increments/decrements the reference count on construction/destruction and assignment. It abstracts away pointer- or string-based identifier usage, guarantees uniqueness and lifetime management, and can be compared for equality.
[AI] Used throughout the engine to efficiently manage string IDs for resources, scripts, events, and more. The internal value (m_internal) is a const char* to the internal string, guaranteed to remain valid as long as at least one MxAtomId refers to it.
MxAtomId::MxAtomId | ( | const char * | p_str, |
LookupMode | p_mode | ||
) |
[AI] Constructs an atom ID for the given string and lookup mode, increments atom reference count.
[in] | char* | The string value to atomize. |
[in] | LookupMode | Lookup mode (case normalization, etc.). |
Definition at line 15 of file mxatom.cpp.
MxAtomId::~MxAtomId | ( | ) |
[AI] Destructor for atom ID.
Decrements the reference count for the referenced atom.
Definition at line 32 of file mxatom.cpp.
|
inline |
void MxAtomId::Clear | ( | ) |
[AI] Disassociates the atom ID from any atom (decrements reference count, sets internal pointer to NULL).
Definition at line 122 of file mxatom.cpp.
|
inline |
[AI] Copy assignment operator.
Decreases reference to current atom if needed, increases reference for the new atom.
p_atomId | [AI] The source to assign from. |
Definition at line 70 of file mxatom.cpp.
|
inline |