libosmscout
0.1
|
#include <NodeUseMap.h>
Public Member Functions | |
void | Clear () |
size_t | GetDuplicateCount () const |
size_t | GetNodeUsedCount () const |
bool | IsNodeUsedAtLeastTwice (Id id) const |
NodeUseMap () | |
void | SetNodeUsed (Id id) |
The NodeUseMap can be used to efficiently check if an id used at least twice. In concrete it is used, to check if a node id is shared by multiple ways/areas.
It is expected that ids are not sparse but continuously used. So while the data structure works for Id, it will likely not work for OSMId.
It internally used large bitsets in a hashset to allow efficient memory usage (only a few entries in hashtable to reduce management overhead but no need for large continuous memory areas) and at the same time fast access (O(1)) for reading and writing.
osmscout::NodeUseMap::NodeUseMap | ( | ) |
void osmscout::NodeUseMap::Clear | ( | ) |
size_t osmscout::NodeUseMap::GetDuplicateCount | ( | ) | const |
size_t osmscout::NodeUseMap::GetNodeUsedCount | ( | ) | const |
bool osmscout::NodeUseMap::IsNodeUsedAtLeastTwice | ( | Id | id | ) | const |
void osmscout::NodeUseMap::SetNodeUsed | ( | Id | id | ) |