#include <NameKeyGenerator.h>
Inherits SubsystemInterface.
Public Member Functions | |
| NameKeyGenerator () | |
| virtual | ~NameKeyGenerator () |
| virtual void | init () |
| virtual void | reset () |
| virtual void | update () |
| NameKeyType | nameToKey (const AsciiString &name) |
| Given a string, convert into a unique integer key. | |
| NameKeyType | nameToLowercaseKey (const AsciiString &name) |
| NameKeyType | nameToKey (const char *name) |
| Given a string, convert into a unique integer key. | |
| NameKeyType | nameToLowercaseKey (const char *name) |
| AsciiString | keyToName (NameKeyType key) |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Static Public Member Functions | |
| static void | parseStringAsNameKeyType (INI *ini, void *instance, void *store, const void *userData) |
Additional Inherited Members | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
This class implements the conversion of an arbitrary string into a unique integer "key". Calling the nameToKey() method with the same string is guaranteed to return the same key. Also, all keys generated by an instance of this class are guaranteed to be unique with respect to that instance's catalog of names. Multiple instances of this class can be created to service multiple namespaces.
Definition at line 85 of file NameKeyGenerator.h.
| NameKeyGenerator::NameKeyGenerator | ( | ) |
Definition at line 37 of file NameKeyGenerator.cpp.
|
virtual |
Definition at line 48 of file NameKeyGenerator.cpp.
|
virtual |
Implements SubsystemInterface.
Definition at line 57 of file NameKeyGenerator.cpp.
| AsciiString NameKeyGenerator::keyToName | ( | NameKeyType | key | ) |
given a key, return the name. this is almost never needed, except for a few rare cases like object serialization. also note that it's not particularly fast; it does a dumb linear search for the key.
Definition at line 112 of file NameKeyGenerator.cpp.
|
inline |
Given a string, convert into a unique integer key.
Definition at line 98 of file NameKeyGenerator.h.
| NameKeyType NameKeyGenerator::nameToKey | ( | const char * | name | ) |
Given a string, convert into a unique integer key.
Definition at line 126 of file NameKeyGenerator.cpp.
|
inline |
Definition at line 99 of file NameKeyGenerator.h.
| NameKeyType NameKeyGenerator::nameToLowercaseKey | ( | const char * | name | ) |
Definition at line 174 of file NameKeyGenerator.cpp.
|
static |
Definition at line 224 of file NameKeyGenerator.cpp.
|
virtual |
Implements SubsystemInterface.
Definition at line 68 of file NameKeyGenerator.cpp.
|
inlinevirtual |
Implements SubsystemInterface.
Definition at line 95 of file NameKeyGenerator.h.