Blender V4.3
NOD_node_in_compute_context.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8#include "BLI_hash.hh"
10
11struct bNode;
12struct bNodeSocket;
13
14namespace blender::nodes {
15
21 const ComputeContext *context = nullptr;
22 const bNode *node = nullptr;
23
24 uint64_t hash() const
25 {
26 return get_default_hash(this->context_hash(), this->node);
27 }
28
30 {
31 return context ? context->hash() : ComputeContextHash{};
32 }
33
39};
40
46 const ComputeContext *context = nullptr;
47 const bNodeSocket *socket = nullptr;
48
49 uint64_t hash() const
50 {
51 return get_default_hash(this->context_hash(), this->socket);
52 }
53
55 {
56 return context ? context->hash() : ComputeContextHash{};
57 }
58
64};
65
66} // namespace blender::nodes
#define BLI_STRUCT_EQUALITY_OPERATORS_2(Type, m1, m2)
uint64_t get_default_hash(const T &v)
Definition BLI_hash.hh:219
unsigned __int64 uint64_t
Definition stdint.h:90