Enzo
Loading...
Searching...
No Matches
Connection.h
1#pragma once
2#include "Engine/Core/Types.h"
3#include <boost/functional/hash.hpp>
4#include <cstddef>
5#include <functional>
6
7namespace enzo::nt {
8
20{
21 OpId sourceOp = 0;
22 unsigned int sourceOutput = 0;
23 OpId targetOp = 0;
24 unsigned int targetInput = 0;
25
26 bool operator==(const Connection& other) const = default;
27};
28
29} // namespace enzo::nt
30
31// Hashing lives in one place so a Connection can key an unordered container.
32template <> struct std::hash<enzo::nt::Connection>
33{
34 std::size_t operator()(const enzo::nt::Connection& connection) const noexcept
35 {
36 std::size_t seed = 0;
37 boost::hash_combine(seed, connection.sourceOp);
38 boost::hash_combine(seed, connection.sourceOutput);
39 boost::hash_combine(seed, connection.targetOp);
40 boost::hash_combine(seed, connection.targetInput);
41 return seed;
42 }
43};
Basic attribute, parameter, and node types for Enzo.
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:137
One wired link between two nodes, the ground truth of the network's wiring.
Definition Connection.h:20