|
Blender V4.3
|
#include <BLI_resource_scope.hh>
Inherits blender::NonCopyable, and blender::NonMovable.
Public Member Functions | |
| ResourceScope () | |
| ~ResourceScope () | |
#ResourceScope Inline Methods | |
| template<typename T > | |
| T * | add (std::unique_ptr< T > resource) |
| template<typename T > | |
| T * | add (destruct_ptr< T > resource) |
| void | add (void *userdata, void(*free)(void *)) |
| template<typename T > | |
| T & | add_value (T &&value) |
| template<typename Func > | |
| void | add_destruct_call (Func func) |
| template<typename T , typename... Args> | |
| T & | construct (Args &&...args) |
| LinearAllocator & | linear_allocator () |
Definition at line 36 of file BLI_resource_scope.hh.
|
default |
| blender::ResourceScope::~ResourceScope | ( | ) |
Definition at line 11 of file resource_scope.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::size().
|
inline |
Pass ownership of the resource to the ResourceScope. It will be destructed when the collector is destructed.
Definition at line 87 of file BLI_resource_scope.hh.
Pass ownership of the resource to the ResourceScope. It will be destructed and freed when the collector is destructed.
Definition at line 70 of file BLI_resource_scope.hh.
References add(), data, and ptr.
Referenced by add(), add(), add_destruct_call(), construct(), and blender::ed::spreadsheet::spreadsheet_main_region_draw().
|
inline |
Pass ownership of some resource to the ResourceScope. The given free function will be called when the collector is destructed.
Definition at line 109 of file BLI_resource_scope.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), data, and free().
|
inline |
The passed in function will be called when the scope is destructed.
Definition at line 129 of file BLI_resource_scope.hh.
References add(), blender::LinearAllocator< Allocator >::allocate(), and data.
Referenced by blender::fn::evaluate_fields().
Construct an object with the same value in the ResourceScope and return a reference to the new value.
Definition at line 121 of file BLI_resource_scope.hh.
References construct().
|
inline |
Utility method to construct an instance of type T that will be owned by the ResourceScope.
Definition at line 139 of file BLI_resource_scope.hh.
References add(), and blender::LinearAllocator< Allocator >::construct().
Referenced by add_value(), blender::fn::build_multi_function_procedure_for_fields(), blender::nodes::partial_eval::eval_downstream(), blender::nodes::partial_eval::eval_upstream(), blender::nodes::LazyFunctionForAnonymousAttributeSetJoin::get_cached(), blender::bke::node_field_inferencing::get_dummy_field_inferencing_interface(), blender::bke::node_field_inferencing::get_node_field_inferencing_interface(), blender::bke::anonymous_attribute_inferencing::get_relations_in_node(), blender::fn::index_mask_from_selection(), blender::fn::multi_function::Params::readonly_vector_input(), and blender::ed::spreadsheet::spreadsheet_filter_rows().
|
inline |
Returns a reference to a linear allocator that is owned by the ResourcesCollector. Memory allocated through this allocator will be freed when the collector is destructed.
Definition at line 151 of file BLI_resource_scope.hh.
Referenced by blender::fn::evaluate_fields().