Skip to content
Snippets Groups Projects
Commit 7f10714f authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

fix so that poses use a resolved accessor when they are optional in the generated operator==

parent 81bc20ba
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,9 @@ namespace armarx::aron::codegenerator::cpp::generator
CppBlockPtr Pose::getEqualsBlock(const std::string& accessor, const std::string& otherInstanceAccessor) const
{
CppBlockPtr block_if_data = std::make_shared<CppBlock>();
block_if_data->addLine("if (not (" + accessor + nextEl() + "isApprox(" + otherInstanceAccessor + ")))");
std::string other_instance_resolved_accessor = this->resolveMaybeAccessor(otherInstanceAccessor);
block_if_data->addLine("if (not (" + accessor + nextEl() + "isApprox(" + other_instance_resolved_accessor + ")))");
block_if_data->addLineAsBlock("return false;");
return resolveMaybeEqualsBlock(block_if_data, accessor, otherInstanceAccessor);
}
......
......@@ -61,7 +61,9 @@
</List>
</ObjectChild>
<ObjectChild key="an_optional_pose">
<Pose />
</ObjectChild>
</Object>
</GenerateTypes>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment