AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ABaseMap< KeyType, ValueType, Parent > Class Template Reference

Base class for maps with AUI extensions.

#include <AUI/Common/AMap.h>

Member Function Documentation

> All members, including inherited

◆ getOrInsert()

template<class KeyType, class ValueType, class Parent>
template<typename Factory>
ValueType & ABaseMap< KeyType, ValueType, Parent >::getOrInsert ( const KeyType & keyType,
Factory && factory )
inlinenoexcept

If value of specified key exists, the existing value returned. Otherwise, factory function called.

Parameters
keyTypekey;
factoryfactory function that will return a new value. Called only if map does not contain value of specified key.
Returns
stored or new value.