Blender V5.0
blender::ComputeContext Class Referenceabstract

#include <BLI_compute_context.hh>

Inherited by blender::bke::ForeachGeometryElementZoneComputeContext, blender::bke::ModifierComputeContext, blender::bke::NodeComputeContext, blender::bke::OperatorComputeContext, blender::bke::RepeatZoneComputeContext, blender::bke::ShaderComputeContext, and blender::bke::SimulationZoneComputeContext.

Public Member Functions

 ComputeContext (const ComputeContext *parent)
virtual ~ComputeContext ()=default
const ComputeContextHashhash () const
const ComputeContextparent () const
void print_stack (std::ostream &stream, StringRef name) const
virtual void print_current_in_line (std::ostream &stream) const =0

Protected Attributes

const ComputeContextparent_ = nullptr
ComputeContextHash hash_

Friends

std::ostream & operator<< (std::ostream &stream, const ComputeContext &compute_context)

Detailed Description

Identifies the context in which a computation happens. This context can be used to identify values logged during the computation. For more details, see the comment at the top of the file.

This class should be subclassed to implement specific contexts.

Definition at line 92 of file BLI_compute_context.hh.

Constructor & Destructor Documentation

◆ ComputeContext()

◆ ~ComputeContext()

virtual blender::ComputeContext::~ComputeContext ( )
virtualdefault

Member Function Documentation

◆ hash()

const ComputeContextHash & blender::ComputeContext::hash ( ) const
inline

Definition at line 114 of file BLI_compute_context.hh.

References hash_.

Referenced by blender::nodes::LazyFunctionForGeometryNode::anonymous_attribute_name_for_output(), blender::nodes::gizmos::apply_gizmo_change(), blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::ed::space_node::compute_context_for_zone(), blender::nodes::LazyFunctionForGroupNode::execute_impl(), blender::nodes::LazyFunctionForSimulationInputsUsage::execute_impl(), blender::nodes::LazyFunctionForSimulationZone::execute_impl(), blender::nodes::LazyFunctionForViewerInputUsage::execute_impl(), blender::nodes::ForeachGeometryElementNodeExecuteWrapper::execute_node(), blender::nodes::RepeatBodyNodeExecuteWrapper::execute_node(), blender::find_side_effect_nodes_for_active_gizmos(), blender::ed::space_node::find_sockets_on_active_gizmo_paths(), blender::nodes::geo_eval_log::find_tree_zone_hash_recursive(), blender::nodes::geo_eval_log::GeoNodesLog::find_viewer_node_log_for_path(), blender::ComputeContextHash::from(), blender::ed::space_node::get_compute_context_hash_for_node_editor(), blender::nodes::geo_eval_log::GeoNodesLog::get_context_hash_by_zone_for_node_editor(), blender::nodes::gizmos::get_editable_gizmo_elem(), blender::nodes::geo_eval_log::GeoNodesLog::get_local_tree_logger(), blender::nodes::ClosureIntermediateGraphSideEffectProvider::get_nodes_with_side_effects(), blender::nodes::ForeachGeometryElementZoneSideEffectProvider::get_nodes_with_side_effects(), blender::nodes::GeometryNodesLazyFunctionSideEffectProvider::get_nodes_with_side_effects(), blender::nodes::RepeatZoneSideEffectProvider::get_nodes_with_side_effects(), blender::nodes::get_root_tree_log(), blender::nodes::gizmo_is_used(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::make_attribute_field(), blender::nodes::node_geo_simulation_cc::make_attribute_field(), blender::ed::geometry::run_node_group_exec(), blender::ed::geometry::run_node_group_ui(), blender::try_add_side_effect_node(), and blender::ed::view3d::geometry_nodes_gizmos::WIDGETGROUP_geometry_nodes_refresh().

◆ parent()

const ComputeContext * blender::ComputeContext::parent ( ) const
inline

◆ print_current_in_line()

virtual void blender::ComputeContext::print_current_in_line ( std::ostream & stream) const
pure virtual

Print information about this specific context. This has to be implemented by each subclass.

References ComputeContext().

Referenced by print_stack().

◆ print_stack()

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const ComputeContext & compute_context )
friend

Definition at line 51 of file compute_context.cc.

References ComputeContext(), and print_stack().

Member Data Documentation

◆ hash_

ComputeContextHash blender::ComputeContext::hash_
mutableprotected

The hash that uniquely identifies this context. It's a combined hash of this context as well as all the parent contexts. It's computed lazily to keep initial construction of compute contexts very cheap.

Definition at line 105 of file BLI_compute_context.hh.

Referenced by hash(), and print_stack().

◆ parent_

const ComputeContext* blender::ComputeContext::parent_ = nullptr
protected

Pointer to the context that this context is child of. That allows nesting compute contexts.

Definition at line 98 of file BLI_compute_context.hh.

Referenced by ComputeContext(), blender::bke::EvaluateClosureComputeContext::is_recursive(), and parent().


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