|
KarmaEngine
Game Engine for practical learning and research purposes
|
Karma's std::map wrapper. More...
#include <KarmaTypes.h>
Public Types | |
| typedef std::map< KeyType, ValueType > | AMap |
| typedef AMap::iterator | AnIterator |
Public Member Functions | |
| KarmaMap () | |
| Constructor. | |
| void | Add (const KeyType &Key, const ValueType &Value) |
| Addes a key-value pair to the map. | |
| bool | Contains (const KeyType &Key) const |
| Checks if the map contains a specified key. | |
| ValueType & | FindOrAdd (const KeyType &Key) |
| Find the value associated with a specified key, or if none exists, adds a value using the default constructor. | |
| ValueType * | Find (const KeyType &Key) |
| Find the value associated with a specified key. | |
| ValueType & | operator[] (const KeyType &Key) |
| Overloaded subscript operator for accessing values by key. | |
| const ValueType & | operator[] (const KeyType &Key) const |
| Overloaded subscript operator for accessing values by key (const version). | |
| uint32_t | Num () const |
| auto | begin () |
| auto | end () |
| auto | begin () const |
| auto | end () const |
Protected Attributes | |
| AMap | m_KeyValuePair |
Karma's std::map wrapper.
|
inline |
Constructor.
|
inline |
Addes a key-value pair to the map.
|
inline |
Checks if the map contains a specified key.
| Key | The key to search for. |
|
inline |
Find the value associated with a specified key.
| Key | The key to search for. |
|
inline |
Find the value associated with a specified key, or if none exists, adds a value using the default constructor.
Algorithm courtsey: https://stackoverflow.com/a/1409465
| Key | The key to search for. |
|
inline |
Overloaded subscript operator for accessing values by key.
| Key | The key whose associated value is to be accessed. |
|
inline |
Overloaded subscript operator for accessing values by key (const version).
| Key | The key whose associated value is to be accessed. |