MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
gid.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <unordered_map>
4
#include <unordered_set>
5
6
#include <ankerl/unordered_dense.h>
7
8
namespace
mim
{
9
10
template
<
class
T>
11
struct
GIDHash
{
12
using
is_avalanching
= void;
13
14
size_t
operator()
(T p)
const
noexcept
{
return
ankerl::unordered_dense::hash<
decltype
(p->gid())>{}(p->gid()); }
15
};
16
17
template
<
class
T>
18
struct
GIDLt
{
19
constexpr
bool
operator()
(T a, T b)
const
noexcept
{
return
a->gid() < b->gid(); }
20
};
21
22
// clang-format off
23
/// @name GID
24
///@{
25
template
<
class
K,
class
V>
using
GIDMap
= ankerl::unordered_dense::map<K, V, GIDHash<K>>;
26
template
<
class
K>
using
GIDSet
= ankerl::unordered_dense::set<K, GIDHash<K>>;
27
template
<
class
K,
class
V>
using
GIDNodeMap
= std::unordered_map<K, V, GIDHash<K>>;
28
template
<
class
K>
using
GIDNodeSet
= std::unordered_set<K, GIDHash<K>>;
29
///@}
30
// clang-format on
31
32
}
// namespace mim
mim
Definition
ast.h:16
mim::GIDMap
ankerl::unordered_dense::map< K, V, GIDHash< K > > GIDMap
Definition
gid.h:25
mim::GIDNodeSet
std::unordered_set< K, GIDHash< K > > GIDNodeSet
Definition
gid.h:28
mim::GIDSet
ankerl::unordered_dense::set< K, GIDHash< K > > GIDSet
Definition
gid.h:26
mim::GIDNodeMap
std::unordered_map< K, V, GIDHash< K > > GIDNodeMap
Definition
gid.h:27
mim::GIDHash
Definition
gid.h:11
mim::GIDHash::operator()
size_t operator()(T p) const noexcept
Definition
gid.h:14
mim::GIDHash::is_avalanching
void is_avalanching
Definition
gid.h:12
mim::GIDLt
Definition
gid.h:18
mim::GIDLt::operator()
constexpr bool operator()(T a, T b) const noexcept
Definition
gid.h:19
include
mim
util
gid.h
Generated by
1.18.0