MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRMesh/MRMapOrHashMap.h>

Public Types

using Dense = Vector<V, K>
using Hash = HashMap<K, V>

Public Member Functions

void setMap (Dense &&m MR_LIFETIME_CAPTURE_BY_NESTED(this))
void setHashMap (Hash &&m MR_LIFETIME_CAPTURE_BY_NESTED(this))
void resizeReserve (size_t denseTotalSize, size_t hashAdditionalCapacity)
void pushBack (K key MR_LIFETIME_CAPTURE_BY_NESTED(this), V val MR_LIFETIME_CAPTURE_BY_NESTED(this))
template<typename F>
void forEach (F &&f) const
 executes given function for all pairs (key, value) with valid value for dense map
DensegetMap () MR_LIFETIMEBOUND
const DensegetMap () const MR_LIFETIMEBOUND
HashgetHashMap () MR_LIFETIMEBOUND
const HashgetHashMap () const MR_LIFETIMEBOUND
void clear ()

Static Public Member Functions

static MapOrHashMap createMap (size_t size=0)
static MapOrHashMap createHashMap (size_t capacity=0)

Public Attributes

std::variant< Dense, Hashvar
 default construction will select dense map

Detailed Description

template<typename K, typename V>
struct MR::MapOrHashMap< K, V >

stores a mapping from keys K to values V in one of two forms: 1) as dense map (vector) preferable when there are few missing keys in a range [0, endKey) 2) as hash map preferable when valid keys are a small subset of the range


The documentation for this struct was generated from the following file: