![]() |
GeoDesk for C++
Fast and storage-efficient spatial database engine for OpenStreetMap features
|
A lightweight wrapper for a key string. More...
#include <Key.h>
Public Member Functions | |
const char * | data () const noexcept |
The character data of the key string. | |
uint32_t | size () const noexcept |
The size of the key string (in bytes, not characters). | |
int | code () const noexcept |
The global-string code of this Key, or -1 if it is not in the global-string table. | |
bool | operator== (const Key &) const =default |
bool | operator!= (const Key &) const =default |
A lightweight wrapper for a key string.
A Key is constructed from a std::string_view
via Features::key() and is valid for all features within the same GOL. A Key created for one GOL cannot be used for lookups in another.
A Key object is useful in scenarios requiring lookups of the same tag across multiple features. It avoids the overhead of resolving the tag's global-string code on every lookup, leading to a performance boost of about 2x to 4x.
Key converts implicitly to std::string_view
.
|
inlinenoexcept |
The global-string code of this Key, or -1 if it is not in the global-string table.
|
inlinenoexcept |
The character data of the key string.
Note: The string is not guaranteed to 0-trminated.
|
default |
|
default |
|
inlinenoexcept |
The size of the key string (in bytes, not characters).