Blender
V3.3
|
#include <BLI_resource_scope.hh>
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 34 of file BLI_resource_scope.hh.
|
default |
blender::ResourceScope::~ResourceScope | ( | ) |
Definition at line 9 of file resource_scope.cc.
References data, and 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 85 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 68 of file BLI_resource_scope.hh.
Referenced by add(), add_destruct_call(), construct(), and spreadsheet_main_region_draw().
Pass ownership of some resource to the ResourceScope. The given free function will be called when the collector is destructed.
Definition at line 107 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 127 of file BLI_resource_scope.hh.
References add(), blender::LinearAllocator< Allocator >::allocate(), buffer, 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 119 of file BLI_resource_scope.hh.
Referenced by blender::ed::spreadsheet::spreadsheet_filter_rows().
|
inline |
Utility method to construct an instance of type T that will be owned by the ResourceScope.
Definition at line 137 of file BLI_resource_scope.hh.
References add(), blender::LinearAllocator< Allocator >::construct(), and T.
Referenced by blender::fn::MFParamsBuilder::add_readonly_vector_input(), blender::fn::build_multi_function_procedure_for_fields(), blender::fn::index_mask_from_selection(), and blender::fn::MFParams::readonly_vector_input().
|
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 149 of file BLI_resource_scope.hh.
Referenced by compute_geometry(), and blender::fn::evaluate_fields().