API Documentation
Loading...
Searching...
No Matches
Dictionary< t_key, t_value, t_hash > Class Template Reference

A hash-based key-value store, useful for quick associative lookups. Key features include: More...

#include <Dictionary.h>

Inheritance diagram for Dictionary< t_key, t_value, t_hash >:
[legend]
Collaboration diagram for Dictionary< t_key, t_value, t_hash >:
[legend]

Public Member Functions

void add (const t_key &key)
 
void add (const t_key &key, const t_value &value)
 
void add (t_key &&key)
 
 Dictionary ()
 
t_value & get (const t_key &key)
 
const t_value & get (const t_key &key) const
 
const t_value & getFromIndex (uint04 index) const
 
bool hasKey (const t_key &key) const
 
uint04 indexOf (const t_key &key) const
 
template<class t_index_type = uint04, class t_memory_allocator = ObjectAllocator<ObjectInfo<t_key>::Primitive, t_index_type>, class t_memory_manager = BufferAllocator<t_key, t_index_type, false>>
Buffer< t_key, t_index_type, t_memory_allocator, t_memory_manager > keys () const
 
t_value & operator[] (const t_key &key)
 
const t_value & operator[] (const t_key &key) const
 
void removeIndex (uint04 index)
 
void set (const t_key &key, const t_value &value)
 
uint04 size () const
 
template<class t_index_type = uint04, class t_memory_allocator = ObjectAllocator<ObjectInfo<t_value>::Primitive, t_index_type>, class t_memory_manager = BufferAllocator<t_value, t_index_type, false>>
Buffer< t_value, t_index_type, t_memory_allocator, t_memory_manager > values () const
 

Detailed Description

template<class t_key, class t_value, class t_hash = std::hash<t_key>>
class NDEVR::Dictionary< t_key, t_value, t_hash >

A hash-based key-value store, useful for quick associative lookups. Key features include:


  • Uses tsl robin library as backing logic and hashmap. Proven to be significantly faster in almost all metrics over std::unordered_set on modern architecture
  • Easy functions for converting to other NDEVR containers

Constructor & Destructor Documentation

◆ Dictionary()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
Dictionary ( )
inline

Member Function Documentation

◆ add() [1/3]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
void add ( const t_key & key)
inline

◆ add() [2/3]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
void add ( const t_key & key,
const t_value & value )
inline

◆ add() [3/3]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
void add ( t_key && key)
inline

◆ get() [1/2]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
t_value & get ( const t_key & key)
inlinenodiscard

◆ get() [2/2]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
const t_value & get ( const t_key & key) const
inlinenodiscard

◆ getFromIndex()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
const t_value & getFromIndex ( uint04 index) const
inlinenodiscard

◆ hasKey()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
bool hasKey ( const t_key & key) const
inlinenodiscard

◆ indexOf()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
uint04 indexOf ( const t_key & key) const
inlinenodiscard

◆ keys()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
template<class t_index_type = uint04, class t_memory_allocator = ObjectAllocator<ObjectInfo<t_key>::Primitive, t_index_type>, class t_memory_manager = BufferAllocator<t_key, t_index_type, false>>
Buffer< t_key, t_index_type, t_memory_allocator, t_memory_manager > keys ( ) const
inlinenodiscard

◆ operator[]() [1/2]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
t_value & operator[] ( const t_key & key)
inlinenodiscard

◆ operator[]() [2/2]

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
const t_value & operator[] ( const t_key & key) const
inlinenodiscard

◆ removeIndex()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
void removeIndex ( uint04 index)
inline

◆ set()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
void set ( const t_key & key,
const t_value & value )
inline

◆ size()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
uint04 size ( ) const
inlinenodiscard

◆ values()

template<class t_key , class t_value , class t_hash = std::hash<t_key>>
template<class t_index_type = uint04, class t_memory_allocator = ObjectAllocator<ObjectInfo<t_value>::Primitive, t_index_type>, class t_memory_manager = BufferAllocator<t_value, t_index_type, false>>
Buffer< t_value, t_index_type, t_memory_allocator, t_memory_manager > values ( ) const
inlinenodiscard

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