1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/common/index_map.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/constants.hpp"
12#include "duckdb/common/unordered_map.hpp"
13#include "duckdb/common/unordered_set.hpp"
14
15namespace duckdb {
16
17struct LogicalIndexHashFunction {
18 uint64_t operator()(const LogicalIndex &index) const {
19 return std::hash<idx_t>()(index.index);
20 }
21};
22
23struct PhysicalIndexHashFunction {
24 uint64_t operator()(const PhysicalIndex &index) const {
25 return std::hash<idx_t>()(index.index);
26 }
27};
28
29template <typename T>
30using logical_index_map_t = unordered_map<LogicalIndex, T, LogicalIndexHashFunction>;
31
32using logical_index_set_t = unordered_set<LogicalIndex, LogicalIndexHashFunction>;
33
34template <typename T>
35using physical_index_map_t = unordered_map<PhysicalIndex, T, PhysicalIndexHashFunction>;
36
37using physical_index_set_t = unordered_set<PhysicalIndex, PhysicalIndexHashFunction>;
38
39} // namespace duckdb
40