Tramway SDK v0.1.1
Classes | Public Member Functions | Protected Types | Protected Attributes | List of all members
tram::Hashmap< T > Class Template Reference

#include <hashmap.h>

Classes

struct  Record
 

Public Member Functions

constexpr Hashmap (const char *name, size_t max_size)
 
constexpr Hashmap (const char *name, size_t max_size, std::initializer_list< std::pair< uint32_t, T > > list)
 
Find (UID key)
 
Find (uint32_t key)
 
bool Exists (UID key)
 
bool Exists (uint32_t key)
 
void Insert (UID key, T value)
 
void Insert (uint32_t key, T value)
 
void Remove (UID key)
 
void Remove (uint32_t key)
 
T & operator[] (UID key)
 
T & operator[] (uint32_t key)
 

Protected Types

enum  { FLAG_RECORD = 1 , FLAG_DELETED = 2 }
 

Protected Attributes

const size_t padding = 10
 
std::string name
 
size_t size = 0
 
size_t max_size = 0
 
uint32_t hash_parameter = 0
 
Recordfirst = nullptr
 
Recordlast = nullptr
 

Member Enumeration Documentation

◆ anonymous enum

template<typename T >
anonymous enum
protected
Enumerator
FLAG_RECORD 
FLAG_DELETED 

Constructor & Destructor Documentation

◆ Hashmap() [1/2]

template<typename T >
constexpr tram::Hashmap< T >::Hashmap ( const char *  name,
size_t  max_size 
)
inlineconstexpr

◆ Hashmap() [2/2]

template<typename T >
constexpr tram::Hashmap< T >::Hashmap ( const char *  name,
size_t  max_size,
std::initializer_list< std::pair< uint32_t, T > >  list 
)
inlineconstexpr

Member Function Documentation

◆ Exists() [1/2]

template<typename T >
bool tram::Hashmap< T >::Exists ( UID  key)
inline

◆ Exists() [2/2]

template<typename T >
bool tram::Hashmap< T >::Exists ( uint32_t  key)
inline

◆ Find() [1/2]

template<typename T >
T tram::Hashmap< T >::Find ( UID  key)
inline

◆ Find() [2/2]

template<typename T >
T tram::Hashmap< T >::Find ( uint32_t  key)
inline

◆ Insert() [1/2]

template<typename T >
void tram::Hashmap< T >::Insert ( UID  key,
value 
)
inline

◆ Insert() [2/2]

template<typename T >
void tram::Hashmap< T >::Insert ( uint32_t  key,
value 
)
inline

◆ operator[]() [1/2]

template<typename T >
T & tram::Hashmap< T >::operator[] ( UID  key)
inline

◆ operator[]() [2/2]

template<typename T >
T & tram::Hashmap< T >::operator[] ( uint32_t  key)
inline

◆ Remove() [1/2]

template<typename T >
void tram::Hashmap< T >::Remove ( UID  key)
inline

◆ Remove() [2/2]

template<typename T >
void tram::Hashmap< T >::Remove ( uint32_t  key)
inline

Member Data Documentation

◆ first

template<typename T >
Record* tram::Hashmap< T >::first = nullptr
protected

◆ hash_parameter

template<typename T >
uint32_t tram::Hashmap< T >::hash_parameter = 0
protected

◆ last

template<typename T >
Record* tram::Hashmap< T >::last = nullptr
protected

◆ max_size

template<typename T >
size_t tram::Hashmap< T >::max_size = 0
protected

◆ name

template<typename T >
std::string tram::Hashmap< T >::name
protected

◆ padding

template<typename T >
const size_t tram::Hashmap< T >::padding = 10
protected

◆ size

template<typename T >
size_t tram::Hashmap< T >::size = 0
protected

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