Catos Engine (Source) 0.0.1
Lightweight Game engine
Loading...
Searching...
No Matches
catos::hashmap< K, V, F > Class Template Reference

#include <hashmap.h>

Public Member Functions

 hashmap (int startSize=8)
 Basic constructor with a startSize of 8.
 
 ~hashmap ()
 
get (const K &key)
 Gets the value based on the key given.
 
void put (const K &key, const V &value)
 puts an item in the table.
 
void remove (const K &key)
 Removes the item.
 
void rehash (int newSize)
 Creates a new table of the given size and rehash all of the previous items.
 

Detailed Description

template<typename K, typename V, typename F = HashFunc<K>>
class catos::hashmap< K, V, F >

Hashmap structure object. NOTE: alot of custom types such as catos::string dont work. Which has to do with my hashing func. You can provide your own if you really want it.

Constructor & Destructor Documentation

◆ hashmap()

template<typename K , typename V , typename F = HashFunc<K>>
catos::hashmap< K, V, F >::hashmap ( int startSize = 8)
inline

Basic constructor with a startSize of 8.

◆ ~hashmap()

template<typename K , typename V , typename F = HashFunc<K>>
catos::hashmap< K, V, F >::~hashmap ( )
inline

Member Function Documentation

◆ get()

template<typename K , typename V , typename F = HashFunc<K>>
V catos::hashmap< K, V, F >::get ( const K & key)
inline

Gets the value based on the key given.

◆ put()

template<typename K , typename V , typename F = HashFunc<K>>
void catos::hashmap< K, V, F >::put ( const K & key,
const V & value )
inline

puts an item in the table.

◆ rehash()

template<typename K , typename V , typename F = HashFunc<K>>
void catos::hashmap< K, V, F >::rehash ( int newSize)
inline

Creates a new table of the given size and rehash all of the previous items.

◆ remove()

template<typename K , typename V , typename F = HashFunc<K>>
void catos::hashmap< K, V, F >::remove ( const K & key)
inline

Removes the item.


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