|
stmm-games-doc
0.32.0
|

Public Member Functions | |
| NamedIndex () noexcept | |
| Default constructor. More... | |
| NamedIndex (const NamedIndex &oSource) noexcept | |
| NamedIndex (NamedIndex &&oSource) noexcept | |
| int32_t | size () const noexcept |
| Returns the number of names. More... | |
| bool | isIndex (int32_t nIndex) const noexcept |
| Whether an index is valid. More... | |
| const std::string & | getName (int32_t nIndex) const noexcept |
| The name associated with a given index. More... | |
| int32_t | addName (const std::string &sName) noexcept |
| Adds a name. More... | |
| int32_t | getIndex (const std::string &sName) const noexcept |
| The index of a name. More... | |
| int32_t | findIndexNameStarts (const std::string &sStartOfName) const noexcept |
| The first index of a name starting with a certain string. More... | |
| void | dump () const noexcept |
Protected Member Functions | |
| NamedIndex & | operator= (const NamedIndex &oSource) noexcept |
| The assignment operator. More... | |
| NamedIndex & | operator= (NamedIndex &&oSource) noexcept |
| void | clear () noexcept |
| Clear all names. More... | |
Named indexes class.
This class allows to uniquely associate a string with a number so that the number can be used instead of the string. Names cannot be removed from this class unless it is assigned (operator=()) or NamedIndex::clear() is called. This ensures that the index associated with the string is always >= 0 and < size().
|
noexcept |
Default constructor.
|
noexcept |
|
noexcept |
|
noexcept |
Adds a name.
If the name already exists nothing is added and the index of the existing name is returned.
| sName | The name to be added. |
|
protectednoexcept |
Clear all names.
If you want to allow assignment you have to subclass NamedIndex and make this function public.
|
noexcept |
|
noexcept |
The first index of a name starting with a certain string.
| sStartOfName | The start of the name to match |
|
noexcept |
The index of a name.
| sName | The name to lookup. |
|
noexcept |
The name associated with a given index.
| nIndex | The index of the name. Must be valid. |
|
inlinenoexcept |
Whether an index is valid.
Index is always >= 0 and < size().
|
protectednoexcept |
The assignment operator.
If you want to allow assignment you have to subclass NamedIndex and make this function public.
|
protectednoexcept |
|
inlinenoexcept |
Returns the number of names.
1.8.13