forked from kovacsv/VisualScriptEngineWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNE_NodeId.hpp
More file actions
54 lines (40 loc) · 901 Bytes
/
NE_NodeId.hpp
File metadata and controls
54 lines (40 loc) · 901 Bytes
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
#ifndef NE_NODEID_HPP
#define NE_NODEID_HPP
#include "NE_Serializable.hpp"
#include <functional>
namespace NE
{
using NodeIdType = size_t;
class NodeId
{
SERIALIZABLE;
public:
NodeId ();
explicit NodeId (const NodeIdType& uniqueId);
~NodeId ();
NodeIdType GetUniqueId () const;
void SetUniqueId (NodeIdType uniqueId);
size_t GenerateHashValue () const;
bool operator< (const NodeId& rhs) const;
bool operator> (const NodeId& rhs) const;
bool operator== (const NodeId& rhs) const;
bool operator!= (const NodeId& rhs) const;
Stream::Status Read (InputStream& inputStream);
Stream::Status Write (OutputStream& outputStream) const;
private:
NodeIdType id;
};
extern const NodeId NullNodeId;
}
namespace std
{
template <>
struct hash<NE::NodeId>
{
size_t operator() (const NE::NodeId& id) const noexcept
{
return id.GenerateHashValue ();
}
};
}
#endif