Functions: simplify adding a single input to a multi-function

This is used by the upcoming new geometry nodes evaluator.
This commit is contained in:
Jacques Lucke 2021-05-13 13:23:53 +02:00
parent 8b87fc1c77
commit 522868001c
1 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include "BLI_resource_scope.hh"
#include "FN_generic_pointer.hh"
#include "FN_generic_vector_array.hh"
#include "FN_generic_virtual_vector_array.hh"
#include "FN_multi_function_signature.hh"
@ -64,6 +65,12 @@ class MFParamsBuilder {
this->add_readonly_single_input(scope_.construct<GVArray_For_GSpan>(__func__, span),
expected_name);
}
void add_readonly_single_input(GPointer value, StringRef expected_name = "")
{
this->add_readonly_single_input(scope_.construct<GVArray_For_SingleValueRef>(
__func__, *value.type(), min_array_size_, value.get()),
expected_name);
}
void add_readonly_single_input(const GVArray &ref, StringRef expected_name = "")
{
this->assert_current_param_type(MFParamType::ForSingleInput(ref.type()), expected_name);