diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-01 16:55:08 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-01 16:55:23 +0300 |
commit | b5c2c3aba886f521a0cade5b8450683c20843d3a (patch) | |
tree | 46878da186ccb49b2bcc3e1de816476aea5cf750 /source/blender/nodes/NOD_node_tree_multi_function.hh | |
parent | f674976edd884d7a9a409042708f2b1169fd4e98 (diff) |
BLI: rename resource collector to resource scope
Differential Revision: https://developer.blender.org/D10857
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_multi_function.hh')
-rw-r--r-- | source/blender/nodes/NOD_node_tree_multi_function.hh | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/nodes/NOD_node_tree_multi_function.hh b/source/blender/nodes/NOD_node_tree_multi_function.hh index df31ee18369..de1f5a0dc70 100644 --- a/source/blender/nodes/NOD_node_tree_multi_function.hh +++ b/source/blender/nodes/NOD_node_tree_multi_function.hh @@ -29,7 +29,7 @@ #include "NOD_type_callbacks.hh" #include "BLI_multi_value_map.hh" -#include "BLI_resource_collector.hh" +#include "BLI_resource_scope.hh" namespace blender::nodes { @@ -190,7 +190,7 @@ class MFNetworkTreeMap { * This data is necessary throughout the generation of a MFNetwork from a node tree. */ struct CommonMFNetworkBuilderData { - ResourceCollector &resources; + ResourceScope &scope; fn::MFNetwork &network; MFNetworkTreeMap &network_map; const DerivedNodeTree &tree; @@ -225,9 +225,9 @@ class MFNetworkBuilderBase { * Returns a resource collector that will only be destructed after the multi-function network is * destructed. */ - ResourceCollector &resources() + ResourceScope &resource_scope() { - return common_.resources; + return common_.scope; } /** @@ -236,9 +236,9 @@ class MFNetworkBuilderBase { template<typename T, typename... Args> T &construct_fn(Args &&... args) { BLI_STATIC_ASSERT((std::is_base_of_v<fn::MultiFunction, T>), ""); - void *buffer = common_.resources.linear_allocator().allocate(sizeof(T), alignof(T)); + void *buffer = common_.scope.linear_allocator().allocate(sizeof(T), alignof(T)); T *fn = new (buffer) T(std::forward<Args>(args)...); - common_.resources.add(destruct_ptr<T>(fn), fn->name().c_str()); + common_.scope.add(destruct_ptr<T>(fn), fn->name().c_str()); return *fn; } }; @@ -382,11 +382,10 @@ class NodeMFNetworkBuilder : public MFNetworkBuilderBase { MFNetworkTreeMap insert_node_tree_into_mf_network(fn::MFNetwork &network, const DerivedNodeTree &tree, - ResourceCollector &resources); + ResourceScope &scope); using MultiFunctionByNode = Map<DNode, const fn::MultiFunction *>; -MultiFunctionByNode get_multi_function_per_node(const DerivedNodeTree &tree, - ResourceCollector &resources); +MultiFunctionByNode get_multi_function_per_node(const DerivedNodeTree &tree, ResourceScope &scope); class DataTypeConversions { private: |