Base module
KVCollection
A keyed value store (values stored by copy, not pointer).
KVCollection
#include <icy/collection.h>A keyed value store (values stored by copy, not pointer).
Public Methods
| Return | Name | Description |
|---|---|---|
KVCollection | Defaulted constructor. | |
bool | add inline | Inserts a value; returns false if key already exists. |
TValue & | get inline | Returns the value or throws. |
constTValue & | get const inline | Returns the value or defaultValue. |
bool | remove inline | |
bool | has const inline | |
bool | empty const inline | |
size_t | size const inline | |
void | clear inline | |
Map & | map inline | |
const Map & | map const inline |
KVCollection
KVCollection() = defaultDefaulted constructor.
add
inline
inline bool add(constTKey & key, constTValue & item)Inserts a value; returns false if key already exists.
get
inline
inline TValue & get(constTKey & key)Returns the value or throws.
get
const inline
inline constTValue & get(constTKey & key, constTValue & defaultValue) constReturns the value or defaultValue.
remove
inline
inline bool remove(constTKey & key)has
const inline
inline bool has(constTKey & key) constempty
const inline
inline bool empty() constsize
const inline
inline size_t size() constclear
inline
inline void clear()map
inline
inline Map & map()map
const inline
inline const Map & map() constProtected Attributes
| Return | Name | Description |
|---|---|---|
Map | _map |
_map
Map _mapPublic Types
| Name | Description |
|---|---|
Map |
Map
std::map< TKey, TValue > Map()