Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-08-19 14:44:15 +0300
committerJacques Lucke <jacques@blender.org>2021-08-19 14:44:15 +0300
commit98e38ce4f32f6fc9f96762b3e35667bca0e19a33 (patch)
treeb9fb4f7b67cb89cdfedc1088956d57a60a833ba6 /source/blender
parent132cf268c045ac3b5e9599b280305f3ceb2c6e73 (diff)
cleanup
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/functions/FN_multi_function_procedure_builder.hh16
-rw-r--r--source/blender/functions/intern/multi_function_procedure_builder.cc4
-rw-r--r--source/blender/functions/tests/FN_multi_function_procedure_test.cc2
3 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/functions/FN_multi_function_procedure_builder.hh b/source/blender/functions/FN_multi_function_procedure_builder.hh
index 347ad52397b..499dd767d50 100644
--- a/source/blender/functions/FN_multi_function_procedure_builder.hh
+++ b/source/blender/functions/FN_multi_function_procedure_builder.hh
@@ -44,30 +44,30 @@ class MFInstructionCursor {
void insert(MFProcedure &procedure, MFInstruction *new_instruction);
};
-struct MFProcedureBuilderBranch;
-
class MFProcedureBuilder {
private:
MFProcedure *procedure_ = nullptr;
Vector<MFInstructionCursor> cursors_;
public:
+ struct Branch;
+
MFProcedureBuilder(MFProcedure &procedure,
MFInstructionCursor initial_cursor = MFInstructionCursor::Entry());
MFProcedureBuilder(Span<MFProcedureBuilder *> builders);
- MFProcedureBuilder(MFProcedureBuilderBranch &branch);
+ MFProcedureBuilder(Branch &branch);
void set_cursor(const MFInstructionCursor &cursor);
void set_cursor(Span<MFInstructionCursor> cursors);
void set_cursor(Span<MFProcedureBuilder *> builders);
- void set_cursor_after_branch(MFProcedureBuilderBranch &branch);
+ void set_cursor_after_branch(Branch &branch);
void insert_destruct(MFVariable &variable);
void insert_destruct(Span<MFVariable *> variables);
- MFProcedureBuilderBranch insert_branch(MFVariable &condition);
+ Branch insert_branch(MFVariable &condition);
MFCallInstruction &insert_call(const MultiFunction &fn);
MFCallInstruction &insert_call(const MultiFunction &fn, Span<MFVariable *> variables);
@@ -95,7 +95,7 @@ class MFProcedureBuilder {
void insert_at_cursors(MFInstruction *instruction);
};
-struct MFProcedureBuilderBranch {
+struct MFProcedureBuilder::Branch {
MFProcedureBuilder branch_true;
MFProcedureBuilder branch_false;
};
@@ -131,7 +131,7 @@ inline MFInstructionCursor MFInstructionCursor::Entry()
* MFProcedureBuilder inline methods.
*/
-inline MFProcedureBuilder::MFProcedureBuilder(MFProcedureBuilderBranch &branch)
+inline MFProcedureBuilder::MFProcedureBuilder(Branch &branch)
: MFProcedureBuilder(*branch.branch_true.procedure_)
{
this->set_cursor_after_branch(branch);
@@ -159,7 +159,7 @@ inline void MFProcedureBuilder::set_cursor(Span<MFInstructionCursor> cursors)
cursors_ = cursors;
}
-inline void MFProcedureBuilder::set_cursor_after_branch(MFProcedureBuilderBranch &branch)
+inline void MFProcedureBuilder::set_cursor_after_branch(Branch &branch)
{
this->set_cursor({&branch.branch_false, &branch.branch_true});
}
diff --git a/source/blender/functions/intern/multi_function_procedure_builder.cc b/source/blender/functions/intern/multi_function_procedure_builder.cc
index 9b920cf4192..c266cfaa6dc 100644
--- a/source/blender/functions/intern/multi_function_procedure_builder.cc
+++ b/source/blender/functions/intern/multi_function_procedure_builder.cc
@@ -112,13 +112,13 @@ Vector<MFVariable *> MFProcedureBuilder::insert_call_with_new_variables(
return output_variables;
}
-MFProcedureBuilderBranch MFProcedureBuilder::insert_branch(MFVariable &condition)
+MFProcedureBuilder::Branch MFProcedureBuilder::insert_branch(MFVariable &condition)
{
MFBranchInstruction &instruction = procedure_->new_branch_instruction();
instruction.set_condition(&condition);
this->insert_at_cursors(&instruction);
- MFProcedureBuilderBranch branch{*procedure_, *procedure_};
+ Branch branch{*procedure_, *procedure_};
branch.branch_true.set_cursor(MFInstructionCursor{instruction, true});
branch.branch_false.set_cursor(MFInstructionCursor{instruction, false});
return branch;
diff --git a/source/blender/functions/tests/FN_multi_function_procedure_test.cc b/source/blender/functions/tests/FN_multi_function_procedure_test.cc
index e6979271d8e..fc2c91d1944 100644
--- a/source/blender/functions/tests/FN_multi_function_procedure_test.cc
+++ b/source/blender/functions/tests/FN_multi_function_procedure_test.cc
@@ -73,7 +73,7 @@ TEST(multi_function_procedure, BranchTest)
MFVariable *var1 = &builder.add_single_mutable_parameter<int>();
MFVariable *var2 = &builder.add_single_input_parameter<bool>();
- MFProcedureBuilderBranch branch = builder.insert_branch(*var2);
+ MFProcedureBuilder::Branch branch = builder.insert_branch(*var2);
branch.branch_false.insert_call(add_10_fn, {var1});
branch.branch_true.insert_call(add_100_fn, {var1});
builder.set_cursor_after_branch(branch);