Blender V4.5
blender::fn::lazy_function::Params Class Referenceabstract

#include <FN_lazy_function.hh>

Inherited by blender::fn::lazy_function::BasicParams, blender::fn::lazy_function::GraphExecutorLFParams, and blender::fn::lazy_function::RemappedParams.

Public Attributes

const LazyFunctionfn_
std::thread::id main_thread_id_
std::atomic< bool > allow_multi_threading_

#Params Inline Methods

 Params (const LazyFunction &fn, bool allow_multi_threading_initially)
void * try_get_input_data_ptr (int index) const
void * try_get_input_data_ptr_or_request (int index)
void * get_output_data_ptr (int index)
void output_set (int index)
bool output_was_set (int index) const
ValueUsage get_output_usage (int index) const
void set_input_unused (int index)
template<typename T>
T extract_input (int index)
template<typename T>
Tget_input (int index) const
template<typename T>
Ttry_get_input_data_ptr (int index) const
template<typename T>
Ttry_get_input_data_ptr_or_request (int index)
template<typename T>
void set_output (int index, T &&value)
bool try_enable_multi_threading ()

Detailed Description

Defines the calling convention for a lazy-function. During execution, a lazy-function retrieves its inputs and sets the outputs through Params.

Definition at line 106 of file FN_lazy_function.hh.

Constructor & Destructor Documentation

◆ Params()

Member Function Documentation

◆ extract_input()

◆ get_input()

◆ get_output_data_ptr()

void * blender::fn::lazy_function::Params::get_output_data_ptr ( int index)
inline

Get a pointer to where the output value should be stored. The value at the pointer is in an uninitialized state at first. The LazyFunction is responsible for initializing the value. After the output has been initialized to its final value, output_set has to be called.

Definition at line 374 of file FN_lazy_function.hh.

References BLI_assert, fn_, and blender::fn::lazy_function::LazyFunction::outputs().

Referenced by blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_field(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_field(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_field(), blender::nodes::LazyFunctionForImplicitConversion::execute_impl(), blender::nodes::LazyFunctionForImplicitInput::execute_impl(), blender::nodes::LazyFunctionForMultiFunctionNode::execute_impl(), blender::nodes::LazyFunctionForMultiInput::execute_impl(), blender::nodes::LazyFunctionForMutedNode::execute_impl(), blender::nodes::LazyFunctionForRerouteNode::execute_impl(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_single(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_single(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_single(), blender::nodes::node_geo_separate_bundle_cc::node_geo_exec(), blender::nodes::LazyFunctionForGeometryNode::output_anonymous_attribute_field(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::output_cached_state(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::output_cached_state(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::output_mixed_cached_state(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::output_mixed_cached_state(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::output_simulation_state_copy(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::output_simulation_state_move(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::pass_through(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::pass_through(), blender::nodes::set_default_value_for_output_socket(), and set_output().

◆ get_output_usage()

◆ output_set()

void blender::fn::lazy_function::Params::output_set ( int index)
inline

Call this after the output value is initialized. After this is called, the value must not be touched anymore. It may be moved or destructed immediately.

Definition at line 381 of file FN_lazy_function.hh.

References BLI_assert, fn_, and blender::fn::lazy_function::LazyFunction::outputs().

Referenced by blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_field(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_field(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_field(), blender::nodes::LazyFunctionForImplicitConversion::execute_impl(), blender::nodes::LazyFunctionForImplicitInput::execute_impl(), blender::nodes::LazyFunctionForMultiInput::execute_impl(), blender::nodes::LazyFunctionForMutedNode::execute_impl(), blender::nodes::LazyFunctionForRerouteNode::execute_impl(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_single(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_single(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_single(), blender::nodes::node_geo_separate_bundle_cc::node_geo_exec(), blender::nodes::LazyFunctionForGeometryNode::output_anonymous_attribute_field(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::output_cached_state(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::output_cached_state(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::output_mixed_cached_state(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::output_mixed_cached_state(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::output_simulation_state_copy(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::output_simulation_state_move(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::pass_through(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::pass_through(), blender::nodes::set_default_value_for_output_socket(), and set_output().

◆ output_was_set()

◆ set_input_unused()

void blender::fn::lazy_function::Params::set_input_unused ( int index)
inline

◆ set_output()

template<typename T>
void blender::fn::lazy_function::Params::set_output ( int index,
T && value )
inline

Definition at line 435 of file FN_lazy_function.hh.

References data, get_output_data_ptr(), output_set(), and T.

Referenced by blender::fn::lazy_function::tests::AddLazyFunction::execute_impl(), blender::fn::lazy_function::tests::PartialEvaluationTestFunction::execute_impl(), blender::nodes::LazyFunctionForBakeInputsUsage::execute_impl(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), blender::nodes::LazyFunctionForExtractingReferenceSet::execute_impl(), blender::nodes::LazyFunctionForGizmoInputsUsage::execute_impl(), blender::nodes::LazyFunctionForGizmoNode::execute_impl(), blender::nodes::LazyFunctionForIndexSwitchSocketUsage::execute_impl(), blender::nodes::LazyFunctionForJoinReferenceSets::execute_impl(), blender::nodes::LazyFunctionForLogicalOr::execute_impl(), blender::nodes::LazyFunctionForRepeatZone::execute_impl(), blender::nodes::LazyFunctionForSimulationInputsUsage::execute_impl(), blender::nodes::LazyFunctionForSwitchSocketUsage::execute_impl(), blender::nodes::LazyFunctionForViewerInputUsage::execute_impl(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchSocketUsage::execute_impl(), blender::nodes::node_geo_warning_cc::LazyFunctionForWarningNode::execute_impl(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), blender::nodes::LazyFunctionForBakeInputsUsage::set_default_outputs(), blender::nodes::LazyFunctionForEvaluateClosureNode::set_default_outputs(), and blender::nodes::LazyFunctionForSimulationInputsUsage::set_default_outputs().

◆ try_enable_multi_threading()

bool blender::fn::lazy_function::Params::try_enable_multi_threading ( )
inline

Returns true when the lazy-function is now allowed to use multi-threading when interacting with this Params. That means, it is allowed to call non-const methods from different threads.

Definition at line 444 of file FN_lazy_function.hh.

References allow_multi_threading_.

◆ try_get_input_data_ptr() [1/2]

template<typename T>
T * blender::fn::lazy_function::Params::try_get_input_data_ptr ( int index) const
inline

Definition at line 423 of file FN_lazy_function.hh.

References T, and try_get_input_data_ptr().

◆ try_get_input_data_ptr() [2/2]

◆ try_get_input_data_ptr_or_request() [1/2]

template<typename T>
T * blender::fn::lazy_function::Params::try_get_input_data_ptr_or_request ( int index)
inline

Definition at line 429 of file FN_lazy_function.hh.

References T, and try_get_input_data_ptr_or_request().

◆ try_get_input_data_ptr_or_request() [2/2]

void * blender::fn::lazy_function::Params::try_get_input_data_ptr_or_request ( int index)
inline

Same as try_get_input_data_ptr, but if the data is not yet available, request it. This makes sure that the data will be available in a future execution of the LazyFunction.

Definition at line 367 of file FN_lazy_function.hh.

References BLI_assert, fn_, and blender::fn::lazy_function::LazyFunction::inputs().

Referenced by blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_field(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_field(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_field(), blender::fn::lazy_function::tests::StoreValueFunction::execute_impl(), blender::nodes::LazyFunctionForExtractingReferenceSet::execute_impl(), blender::nodes::LazyFunctionForGeometryNode::execute_impl(), blender::nodes::LazyFunctionForGizmoNode::execute_impl(), blender::nodes::LazyFunctionForJoinReferenceSets::execute_impl(), blender::nodes::LazyFunctionForLogicalOr::execute_impl(), blender::nodes::LazyFunctionForMutedNode::execute_impl(), blender::nodes::node_geo_warning_cc::LazyFunctionForWarningNode::execute_impl(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_single(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_single(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_single(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::get_bake_state_from_inputs(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::get_bake_state_from_inputs(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group_lazyness(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::pass_through(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::store_new_state(), and try_get_input_data_ptr_or_request().

Member Data Documentation

◆ allow_multi_threading_

std::atomic<bool> blender::fn::lazy_function::Params::allow_multi_threading_

Definition at line 114 of file FN_lazy_function.hh.

Referenced by Params(), and try_enable_multi_threading().

◆ fn_

const LazyFunction& blender::fn::lazy_function::Params::fn_

◆ main_thread_id_

std::thread::id blender::fn::lazy_function::Params::main_thread_id_

Definition at line 113 of file FN_lazy_function.hh.

Referenced by Params().


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