|
CeresEngine 0.2.0
A game development framework
|
A database that uses a highly optimized hash table. More...
#include <CeresEngine/Foundation/StringID.hpp>
Public Member Functions | |
| MapStringDatabase (std::size_t size=1024, double maxLoadFactor=1.0) | |
| Creates a new database with given number of buckets and maximum load factor. | |
| ~MapStringDatabase () noexcept override | |
| StringID::Status | insert (StringID::Hash hash, StringView string) override |
| Inserts a new hash-string-pair with prefix (optional) into the internal database. | |
| StringID::Status | insertPrefix (StringID::Hash hash, StringID::Hash prefix, StringView string) override |
| Inserts a hash-string-pair with given prefix into the internal database. | |
| StringView | lookup (StringID::Hash hash) const noexcept override |
| Returns the string stored with a given hash. | |
Public Member Functions inherited from CeresEngine::StringDatabase | |
| StringDatabase (const StringDatabase &)=delete | |
| StringDatabase (StringDatabase &&)=delete | |
| virtual | ~StringDatabase ()=default |
Private Member Functions | |
| void | rehash () |
Private Attributes | |
| std::unique_ptr< NodeList[]> | mBuckets |
| std::size_t | mItemCount |
| std::size_t | mBucketCount |
| double | mMaximumLoadFactor |
| std::size_t | mNextResize |
Additional Inherited Members | |
Static Public Member Functions inherited from CeresEngine::StringDatabase | |
| static StringDatabase & | getDefault () noexcept |
Protected Member Functions inherited from CeresEngine::StringDatabase | |
| StringDatabase ()=default | |
A database that uses a highly optimized hash table.
|
explicit |
Creates a new database with given number of buckets and maximum load factor.
|
overridenoexcept |
|
overridevirtual |
Inserts a new hash-string-pair with prefix (optional) into the internal database.
| hash | The hash of the string. |
| string | The string which does not need to be null-terminated. |
Implements CeresEngine::StringDatabase.
|
overridevirtual |
Inserts a hash-string-pair with given prefix into the internal database.
insert. Override it if you can do it more efficiently.| hash | The hash of the string plus prefix. |
| prefix | The hash of the prefix-string. |
| string | The suffix which does not need to be null-terminated. |
Reimplemented from CeresEngine::StringDatabase.
|
overridevirtualnoexcept |
Returns the string stored with a given hash.
Implements CeresEngine::StringDatabase.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |