aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/kiwisolver/py3/kiwi/symbol.h
blob: 2c49a5c2f1f76c7a1a88f86286a2e7cf90c2ad0d (plain) (blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*-----------------------------------------------------------------------------
| Copyright (c) 2013-2017, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
#pragma once


namespace kiwi
{

namespace impl
{

class Symbol
{

public:

	using Id = unsigned long long;

	enum Type
	{
		Invalid,
		External,
		Slack,
		Error,
		Dummy
	};

	Symbol() : m_id( 0 ), m_type( Invalid ) {}

	Symbol( Type type, Id id ) : m_id( id ), m_type( type ) {}

	~Symbol() = default;

	Id id() const
	{
		return m_id;
	}

	Type type() const
	{
		return m_type;
	}

private:

	Id m_id;
	Type m_type;

	friend bool operator<( const Symbol& lhs, const Symbol& rhs )
	{
		return lhs.m_id < rhs.m_id;
	}

	friend bool operator==( const Symbol& lhs, const Symbol& rhs )
	{
		return lhs.m_id == rhs.m_id;
	}

};

} // namespace impl

} // namespace kiwi