Public Types | |
typedef unsigned short | Index |
Public Member Functions | |
CNamedIndex () | |
Construct an empty collection. | |
CNamedIndex (Index maxIndices) | |
CNamedIndex (const CNamedIndex &rhs) | |
CNamedIndex & | operator= (const CNamedIndex &rhs) |
Index | Add (const _tstring &name) |
Allocates a new index called name and returns the value. Throws an exception if the name already exists or if the collection has already had Lock() called on it. | |
Index | Find (const _tstring &name) const |
Finds an index called name and returns the value. Throws an exception if the name does not exist. | |
Index | FindOrAdd (const _tstring &name) |
First attempts to Find() an index by name and if the name doesn't already exist then creates a new index called name and returns the value. Throws an exception if the collection has already had Lock() called on it. | |
Index | GetMaxIndexValue () const |
Returns the number of indices allocated. | |
Index | Lock () |
Locks the collection against further additions and returns the number of indices allocated. | |
bool | Locked () const |
Returns true if the collection is locked. |
typedef unsigned short Index |
CNamedIndex | ( | ) |
Construct an empty collection.
CNamedIndex | ( | Index | maxIndices | ) | [explicit] |
CNamedIndex | ( | const CNamedIndex & | rhs | ) |
CNamedIndex& operator= | ( | const CNamedIndex & | rhs | ) |
CNamedIndex::Index Add | ( | const _tstring & | name | ) |
Allocates a new index called name and returns the value. Throws an exception if the name already exists or if the collection has already had Lock() called on it.
CNamedIndex::Index Find | ( | const _tstring & | name | ) | const |
Finds an index called name and returns the value. Throws an exception if the name does not exist.
CNamedIndex::Index FindOrAdd | ( | const _tstring & | name | ) |
CNamedIndex::Index GetMaxIndexValue | ( | ) | const |
Returns the number of indices allocated.
CNamedIndex::Index Lock | ( | ) |
Locks the collection against further additions and returns the number of indices allocated.
bool Locked | ( | ) | const |
Returns true if the collection is locked.