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
Merge requests
!190
ArMem: Revice get/find interface
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
ArMem: Revice get/find interface
armem/get-find-interface
into
armem/dev
Overview
0
Commits
19
Pipelines
0
Changes
7
Merged
Rainer Kartmann
requested to merge
armem/get-find-interface
into
armem/dev
3 years ago
Overview
0
Commits
19
Pipelines
0
Changes
7
Expand
0
0
Merge request reports
Viewing commit
11298761
Prev
Next
Show latest version
7 files
+
84
−
52
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
11298761
Fix max history size inheritance on adding children
· 11298761
Rainer Kartmann
authored
3 years ago
source/RobotAPI/libraries/armem/core/base/detail/MemoryContainerBase.h
+
22
−
0
Options
@@ -108,6 +108,15 @@ namespace armarx::armem::base::detail
return
_container
;
}
DerivedT
&
_derived
()
{
return
static_cast
<
DerivedT
&>
(
*
this
);
}
const
DerivedT
&
_derived
()
const
{
return
static_cast
<
DerivedT
&>
(
*
this
);
}
/**
* @throw `armem::error::ContainerNameMismatch` if `gottenName` does not match `actualName`.
@@ -123,6 +132,19 @@ namespace armarx::armem::base::detail
}
template
<
class
ChildT
,
class
KeyT
,
class
...
ChildArgs
>
ChildT
&
_addChild
(
const
KeyT
&
key
,
ChildArgs
...
childArgs
)
{
auto
[
it
,
inserted
]
=
this
->
_container
.
try_emplace
(
key
,
childArgs
...);
if
(
not
inserted
)
{
throw
armem
::
error
::
ContainerEntryAlreadyExists
(
ChildT
::
getLevelName
(),
key
,
DerivedT
::
getLevelName
(),
this
->
_derived
().
name
());
}
return
it
->
second
;
}
protected
:
mutable
ContainerT
_container
;
Loading