|
Blender V5.0
|
#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 LazyFunction & | fn_ |
| 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> | |
| T & | get_input (int index) const |
| template<typename T> | |
| T * | try_get_input_data_ptr (int index) const |
| template<typename T> | |
| T * | try_get_input_data_ptr_or_request (int index) |
| template<typename T> | |
| void | set_output (int index, T &&value) |
| bool | try_enable_multi_threading () |
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.
|
inline |
Definition at line 350 of file FN_lazy_function.hh.
References allow_multi_threading_, fn_, FN_LAZY_FUNCTION_DEBUG_THREADS, and main_thread_id_.
Referenced by blender::fn::lazy_function::BasicParams::BasicParams(), blender::fn::lazy_function::GraphExecutorLFParams::GraphExecutorLFParams(), and blender::fn::lazy_function::RemappedParams::RemappedParams().
Typed utility methods that wrap the methods above.
Definition at line 407 of file FN_lazy_function.hh.
References BLI_assert, data, T, and try_get_input_data_ptr().
Definition at line 416 of file FN_lazy_function.hh.
References BLI_assert, data, T, and try_get_input_data_ptr().
|
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, and fn_.
Referenced by set_output().
|
inline |
Can be used to detect which outputs have to be computed.
Definition at line 394 of file FN_lazy_function.hh.
References BLI_assert, and fn_.
|
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, and fn_.
Referenced by set_output().
|
inline |
Allows the LazyFunction to check whether an output was computed already without keeping track of it itself.
Definition at line 388 of file FN_lazy_function.hh.
References BLI_assert, and fn_.
|
inline |
Tell the caller of the LazyFunction that a specific input will definitely not be used. Only an input that was not #ValueUsage::Used can become unused.
Definition at line 400 of file FN_lazy_function.hh.
References BLI_assert, and fn_.
|
inline |
Definition at line 435 of file FN_lazy_function.hh.
References data, get_output_data_ptr(), output_set(), and T.
Referenced by blender::nodes::node_geo_separate_bundle_cc::node_geo_exec().
|
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_.
|
inline |
Definition at line 423 of file FN_lazy_function.hh.
References T, and try_get_input_data_ptr().
|
inline |
Get a pointer to an input value if the value is available already. Otherwise null is returned.
The LazyFunction must leave returned object in an initialized state, but can move from it.
Definition at line 361 of file FN_lazy_function.hh.
References BLI_assert, and fn_.
Referenced by extract_input(), get_input(), and try_get_input_data_ptr().
|
inline |
Definition at line 429 of file FN_lazy_function.hh.
References T, and try_get_input_data_ptr_or_request().
|
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, and fn_.
Referenced by try_get_input_data_ptr_or_request().
| 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().
| const LazyFunction& blender::fn::lazy_function::Params::fn_ |
The lazy-function this Params has been prepared for.
Definition at line 111 of file FN_lazy_function.hh.
Referenced by get_output_data_ptr(), get_output_usage(), output_set(), output_was_set(), Params(), set_input_unused(), try_get_input_data_ptr(), and try_get_input_data_ptr_or_request().
| std::thread::id blender::fn::lazy_function::Params::main_thread_id_ |
Definition at line 113 of file FN_lazy_function.hh.
Referenced by Params().