Skip to content
Snippets Groups Projects
Commit cf446968 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix wm visitor

parent 8fb815b1
No related branches found
No related tags found
No related merge requests found
......@@ -19,62 +19,82 @@ namespace armarx::armem::wm
bool Visitor::applyTo(Memory& memory)
{
bool cont = true;
visitEnter(memory);
for (auto& [_, coreSeg] : memory)
{
if (!applyTo(coreSeg))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(memory);
return cont;
}
bool Visitor::applyTo(CoreSegment& coreSegment)
{
bool cont = true;
visitEnter(coreSegment);
for (auto& [_, provSeg] : coreSegment)
{
if (!applyTo(provSeg))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(coreSegment);
return cont;
}
bool Visitor::applyTo(ProviderSegment& providerSegment)
{
bool cont = true;
visitEnter(providerSegment);
for (auto& [_, entity] : providerSegment)
{
if (!applyTo(entity))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(providerSegment);
return cont;
}
bool Visitor::applyTo(Entity& entity)
{
bool cont = true;
visitEnter(entity);
for (auto& [_, snapshot] : entity)
{
if (!applyTo(snapshot))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(entity);
return cont;
}
bool Visitor::applyTo(EntitySnapshot& snapshot)
{
bool cont = true;
visitEnter(snapshot);
for (auto& instance : snapshot)
{
if (!applyTo(instance))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(snapshot);
return cont;
}
bool Visitor::applyTo(EntityInstance& instance)
......@@ -85,62 +105,82 @@ namespace armarx::armem::wm
bool Visitor::applyTo(const Memory& memory)
{
bool cont = true;
visitEnter(memory);
for (const auto& [_, coreSeg] : memory)
{
if (!applyTo(coreSeg))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(memory);
return cont;
}
bool Visitor::applyTo(const CoreSegment& coreSegment)
{
bool cont = true;
visitEnter(coreSegment);
for (const auto& [_, provSeg] : coreSegment)
{
if (!applyTo(provSeg))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(coreSegment);
return cont;
}
bool Visitor::applyTo(const ProviderSegment& providerSegment)
{
bool cont = true;
visitEnter(providerSegment);
for (const auto& [_, entity] : providerSegment)
{
if (!applyTo(entity))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(providerSegment);
return cont;
}
bool Visitor::applyTo(const Entity& entity)
{
bool cont = true;
visitEnter(entity);
for (const auto& [_, snapshot] : entity)
{
if (!applyTo(snapshot))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(entity);
return cont;
}
bool Visitor::applyTo(const EntitySnapshot& snapshot)
{
bool cont = true;
visitEnter(snapshot);
for (const auto& instance : snapshot)
{
if (!applyTo(instance))
{
return false;
cont = false;
break;
}
}
return true;
visitExit(snapshot);
return cont;
}
bool Visitor::applyTo(const EntityInstance& instance)
......
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