summaryrefslogtreecommitdiff
path: root/deimos/core/id_name.h
blob: e158675ad7639b7d224ca5c9b16baa895a89109e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "deimos/core/base.h"
#include "deimos/core/hash.h"

namespace deimos
{

struct IdName
{
    uint128_t hash;
    gsl::czstring name;

    explicit constexpr IdName(gsl::czstring name_) :
        hash{MurmurHash3_x64_128(name_)},
        name{name_}
    {}

    constexpr bool operator==(const IdName& other) const
    {
        return hash == other.hash;
    }
};

} // namespace deimos