KVCollection
KVCollection
#include <icy/collection.h>template<classTKey, classTValue>
class KVCollectionDefined in src/base/include/icy/collection.h:135
A keyed value store (values stored by copy, not pointer).
List of all members
| Name | Kind | Owner |
|---|---|---|
KVCollection | function | Declared here |
~KVCollection | function | Declared here |
add | function | Declared here |
get | function | Declared here |
get | function | Declared here |
remove | function | Declared here |
has | function | Declared here |
empty | function | Declared here |
size | function | Declared here |
clear | function | Declared here |
map | function | Declared here |
map | function | Declared here |
_map | variable | Declared here |
Map | typedef | Declared here |
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() = defaultDefined in src/base/include/icy/collection.h:140
Defaulted constructor.
add
inline
inline bool add(constTKey & key, constTValue & item)Defined in src/base/include/icy/collection.h:144
Inserts a value; returns false if key already exists.
get
inline
inline TValue & get(constTKey & key)Defined in src/base/include/icy/collection.h:151
Returns the value or throws.
get
const inline
inline constTValue & get(constTKey & key, constTValue & defaultValue) constDefined in src/base/include/icy/collection.h:160
Returns the value or defaultValue.
remove
inline
inline bool remove(constTKey & key)Defined in src/base/include/icy/collection.h:166
has
const inline
inline bool has(constTKey & key) constDefined in src/base/include/icy/collection.h:167
empty
const inline
inline bool empty() constDefined in src/base/include/icy/collection.h:168
size
const inline
inline size_t size() constDefined in src/base/include/icy/collection.h:169
clear
inline
inline void clear()Defined in src/base/include/icy/collection.h:170
map
inline
inline Map & map()Defined in src/base/include/icy/collection.h:171
map
const inline
inline const Map & map() constDefined in src/base/include/icy/collection.h:172
Protected Attributes
| Return | Name | Description |
|---|---|---|
Map | _map |
_map
Map _mapDefined in src/base/include/icy/collection.h:175
Public Types
| Name | Description |
|---|---|
Map |
Map
using Map = std::map< TKey, TValue >