Blender V5.0
blender::ComputeContextHash Struct Reference

#include <BLI_compute_context.hh>

Public Member Functions

uint64_t hash () const

Static Public Member Functions

template<size_t N, typename... Args>
static ComputeContextHash from (const ComputeContext *parent, const char(&type_str)[N], Args &&...args)

Public Attributes

uint64_t v1 = 0
uint64_t v2 = 0

Friends

std::ostream & operator<< (std::ostream &stream, const ComputeContextHash &hash)

Detailed Description

A hash that uniquely identifies a specific (non-fixed-size) compute context. The hash has to have enough bits to make collisions practically impossible.

Definition at line 49 of file BLI_compute_context.hh.

Member Function Documentation

◆ from()

template<size_t N, typename... Args>
ComputeContextHash blender::ComputeContextHash::from ( const ComputeContext * parent,
const char(&) type_str[N],
Args &&... args )
inlinestatic

Standard way to create a compute context hash.

Parameters
parentThe optional parent context.
type_strA string literal that identifies the context type. This is used to avoid hash collisions between different context types.
argsAdditional arguments that affect the hash. Note that only the shallow bytes of these types are used. So they generally should not contain any padding.

Definition at line 143 of file BLI_compute_context.hh.

References blender::ComputeContext::hash(), and N.

◆ hash()

uint64_t blender::ComputeContextHash::hash ( ) const
inline

Definition at line 53 of file BLI_compute_context.hh.

References v1.

Referenced by operator<<, and blender::try_add_side_effect_node().

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const ComputeContextHash & hash )
friend

Definition at line 27 of file compute_context.cc.

References hash().

Member Data Documentation

◆ v1

uint64_t blender::ComputeContextHash::v1 = 0

Definition at line 50 of file BLI_compute_context.hh.

Referenced by hash().

◆ v2

uint64_t blender::ComputeContextHash::v2 = 0

Definition at line 51 of file BLI_compute_context.hh.


The documentation for this struct was generated from the following files: