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

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

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

Returns the value or defaultValue.


remove

inline

inline bool remove(constTKey & key)

has

const inline

inline bool has(constTKey & key) const

empty

const inline

inline bool empty() const

size

const inline

inline size_t size() const

clear

inline

inline void clear()

map

inline

inline Map & map()

map

const inline

inline const Map & map() const

Protected Attributes

ReturnNameDescription
Map_map

_map

Map _map

Public Types

NameDescription
Map

Map

std::map< TKey, TValue > Map()