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
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
RobotAPI
Commits
5a65fd97
Commit
5a65fd97
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix names in MemoryToIceAdapter
parent
eef51d59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp
+17
-17
17 additions, 17 deletions
...ce/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp
source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.h
+5
-5
5 additions, 5 deletions
source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.h
with
22 additions
and
22 deletions
source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp
+
17
−
17
View file @
5a65fd97
...
...
@@ -12,7 +12,7 @@
namespace
armarx
::
armem
::
server
{
MemoryToIceAdapter
::
MemoryToIceAdapter
(
wm
::
Memory
*
workingmemory
,
ltm
::
Memory
*
longtermmemory
)
:
working
m
emory
(
workingmemory
),
longterm
m
emory
(
longtermmemory
)
MemoryToIceAdapter
::
MemoryToIceAdapter
(
wm
::
Memory
*
workingmemory
,
ltm
::
Memory
*
longtermmemory
)
:
working
M
emory
(
workingmemory
),
longterm
M
emory
(
longtermmemory
)
{
}
...
...
@@ -20,7 +20,7 @@ namespace armarx::armem::server
void
MemoryToIceAdapter
::
setMemoryListener
(
client
::
MemoryListenerInterfacePrx
memoryListener
)
{
this
->
memoryListener
=
memoryListener
;
this
->
memoryListener
Topic
=
memoryListener
;
}
...
...
@@ -29,20 +29,20 @@ namespace armarx::armem::server
MemoryToIceAdapter
::
addSegment
(
const
data
::
AddSegmentInput
&
input
,
bool
addCoreSegments
)
{
ARMARX_DEBUG
<<
"Adding segment '"
<<
input
.
coreSegmentName
<<
"/"
<<
input
.
providerSegmentName
<<
"'."
;
ARMARX_CHECK_NOT_NULL
(
working
m
emory
);
ARMARX_CHECK_NOT_NULL
(
working
M
emory
);
data
::
AddSegmentResult
output
;
armem
::
wm
::
CoreSegment
*
coreSegment
=
nullptr
;
try
{
coreSegment
=
&
working
m
emory
->
getCoreSegment
(
input
.
coreSegmentName
);
coreSegment
=
&
working
M
emory
->
getCoreSegment
(
input
.
coreSegmentName
);
}
catch
(
const
armem
::
error
::
MissingEntry
&
e
)
{
if
(
addCoreSegments
)
{
coreSegment
=
&
working
m
emory
->
addCoreSegment
(
input
.
coreSegmentName
);
coreSegment
=
&
working
M
emory
->
addCoreSegment
(
input
.
coreSegmentName
);
}
else
{
...
...
@@ -71,7 +71,7 @@ namespace armarx::armem::server
}
armem
::
MemoryID
segmentID
;
segmentID
.
memoryName
=
working
m
emory
->
name
();
segmentID
.
memoryName
=
working
M
emory
->
name
();
segmentID
.
coreSegmentName
=
input
.
coreSegmentName
;
segmentID
.
providerSegmentName
=
input
.
providerSegmentName
;
...
...
@@ -84,7 +84,7 @@ namespace armarx::armem::server
data
::
AddSegmentsResult
MemoryToIceAdapter
::
addSegments
(
const
data
::
AddSegmentsInput
&
input
,
bool
addCoreSegments
)
{
ARMARX_CHECK_NOT_NULL
(
working
m
emory
);
ARMARX_CHECK_NOT_NULL
(
working
M
emory
);
data
::
AddSegmentsResult
output
;
for
(
const
auto
&
i
:
input
)
...
...
@@ -97,7 +97,7 @@ namespace armarx::armem::server
data
::
CommitResult
MemoryToIceAdapter
::
commit
(
const
data
::
Commit
&
commitIce
,
Time
timeArrived
)
{
ARMARX_CHECK_NOT_NULL
(
working
m
emory
);
ARMARX_CHECK_NOT_NULL
(
working
M
emory
);
armem
::
Commit
commit
;
armem
::
fromIce
(
commitIce
,
commit
,
timeArrived
);
...
...
@@ -121,7 +121,7 @@ namespace armarx::armem::server
MemoryToIceAdapter
::
commit
(
const
armem
::
Commit
&
commit
)
{
std
::
vector
<
data
::
MemoryID
>
updatedIDs
;
const
bool
publishUpdates
=
memoryListener
;
const
bool
publishUpdates
=
memoryListener
Topic
;
CommitResult
commitResult
;
for
(
const
EntityUpdate
&
update
:
commit
.
updates
)
...
...
@@ -129,7 +129,7 @@ namespace armarx::armem::server
EntityUpdateResult
&
result
=
commitResult
.
results
.
emplace_back
();
try
{
MemoryID
snapshotID
=
working
m
emory
->
update
(
update
);
MemoryID
snapshotID
=
working
M
emory
->
update
(
update
);
result
.
success
=
true
;
result
.
snapshotID
=
snapshotID
;
...
...
@@ -150,7 +150,7 @@ namespace armarx::armem::server
if
(
publishUpdates
)
{
memoryListener
->
memoryUpdated
(
updatedIDs
);
memoryListener
Topic
->
memoryUpdated
(
updatedIDs
);
}
return
commitResult
;
...
...
@@ -161,18 +161,18 @@ namespace armarx::armem::server
armem
::
query
::
data
::
Result
MemoryToIceAdapter
::
query
(
const
armem
::
query
::
data
::
Input
&
input
)
{
ARMARX_CHECK_NOT_NULL
(
working
m
emory
);
ARMARX_CHECK_NOT_NULL
(
working
M
emory
);
armem
::
wm
::
query_proc
::
MemoryQueryProcessor
processor
(
input
.
withData
?
armem
::
DataMode
::
WithData
:
armem
::
DataMode
::
NoData
);
return
processor
.
process
(
input
,
*
working
m
emory
);
return
processor
.
process
(
input
,
*
working
M
emory
);
}
// LTM LOADING
query
::
data
::
Result
MemoryToIceAdapter
::
load
(
const
armem
::
query
::
data
::
Input
&
query
)
{
ARMARX_CHECK_NOT_NULL
(
longterm
m
emory
);
ARMARX_CHECK_NOT_NULL
(
longterm
M
emory
);
query
::
data
::
Result
output
;
output
.
success
=
true
;
...
...
@@ -182,8 +182,8 @@ namespace armarx::armem::server
// LTM STORING
data
::
StoreResult
MemoryToIceAdapter
::
store
(
const
armem
::
data
::
StoreInput
&
input
)
{
ARMARX_CHECK_NOT_NULL
(
working
m
emory
);
ARMARX_CHECK_NOT_NULL
(
longterm
m
emory
);
ARMARX_CHECK_NOT_NULL
(
working
M
emory
);
ARMARX_CHECK_NOT_NULL
(
longterm
M
emory
);
data
::
StoreResult
output
;
armem
::
query
::
data
::
Result
queryResult
=
this
->
query
(
input
.
query
);
...
...
@@ -191,7 +191,7 @@ namespace armarx::armem::server
{
wm
::
Memory
m
;
fromIce
(
queryResult
.
memory
,
m
);
longterm
m
emory
->
append
(
m
);
longterm
M
emory
->
append
(
m
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.h
+
5
−
5
View file @
5a65fd97
...
...
@@ -22,9 +22,9 @@ namespace armarx::armem::server
public:
/// Construct an MemoryToIceAdapter from an existing Memory.
MemoryToIceAdapter
(
wm
::
Memory
*
working
m
emory
=
nullptr
,
ltm
::
Memory
*
longterm
m
emory
=
nullptr
);
MemoryToIceAdapter
(
wm
::
Memory
*
working
M
emory
=
nullptr
,
ltm
::
Memory
*
longterm
M
emory
=
nullptr
);
void
setMemoryListener
(
client
::
MemoryListenerInterfacePrx
memoryListener
);
void
setMemoryListener
(
client
::
MemoryListenerInterfacePrx
memoryListener
Topic
);
// WRITING
...
...
@@ -50,10 +50,10 @@ namespace armarx::armem::server
public:
wm
::
Memory
*
working
m
emory
;
ltm
::
Memory
*
longterm
m
emory
;
wm
::
Memory
*
working
M
emory
;
ltm
::
Memory
*
longterm
M
emory
;
client
::
MemoryListenerInterfacePrx
memoryListener
;
client
::
MemoryListenerInterfacePrx
memoryListener
Topic
;
};
...
...
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