Home
Base module

KVCollection

A keyed value store (values stored by copy, not pointer).

KVCollection

#include <icy/collection.h>
template<classTKey, classTValue>
class KVCollection

Defined in src/base/include/icy/collection.h:135

A keyed value store (values stored by copy, not pointer).

List of all members

NameKindOwner
KVCollectionfunctionDeclared here
~KVCollectionfunctionDeclared here
addfunctionDeclared here
getfunctionDeclared here
getfunctionDeclared here
removefunctionDeclared here
hasfunctionDeclared here
emptyfunctionDeclared here
sizefunctionDeclared here
clearfunctionDeclared here
mapfunctionDeclared here
mapfunctionDeclared here
_mapvariableDeclared here
MaptypedefDeclared here

Public Methods

ReturnNameDescription
KVCollectionDefaulted constructor.
booladd inlineInserts a value; returns false if key already exists.
TValue &get inlineReturns the value or throws.
constTValue &get const inlineReturns the value or defaultValue.
boolremove inline
boolhas const inline
boolempty const inline
size_tsize const inline
voidclear inline
Map &map inline
const Map &map const inline

KVCollection

KVCollection() = default

Defined 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) const

Defined 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) const

Defined in src/base/include/icy/collection.h:167


empty

const inline

inline bool empty() const

Defined in src/base/include/icy/collection.h:168


size

const inline

inline size_t size() const

Defined 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() const

Defined in src/base/include/icy/collection.h:172

Protected Attributes

ReturnNameDescription
Map_map

_map

Map _map

Defined in src/base/include/icy/collection.h:175

Public Types

NameDescription
Map

Map

using Map = std::map< TKey, TValue >

Defined in src/base/include/icy/collection.h:138