Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
cf446968
Commit
cf446968
authored
3 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix wm visitor
parent
8fb815b1
No related branches found
No related tags found
1 merge request
!157
armem/dev => master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/armem/core/workingmemory/Visitor.cpp
+60
-20
60 additions, 20 deletions
...e/RobotAPI/libraries/armem/core/workingmemory/Visitor.cpp
with
60 additions
and
20 deletions
source/RobotAPI/libraries/armem/core/workingmemory/Visitor.cpp
+
60
−
20
View file @
cf446968
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment