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
!178
Draft: Make RobotStateMemory ready
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Draft: Make RobotStateMemory ready
armem/robot-state-memory
into
master
Overview
1
Commits
48
Pipelines
0
Changes
3
Merged
Rainer Kartmann
requested to merge
armem/robot-state-memory
into
master
3 years ago
Overview
1
Commits
48
Pipelines
0
Changes
3
Expand
Goal:
Make stable (especially race conditions)
Improve runtime
Add profiling/monitoring
Refactor code
Add missing interfaces
0
0
Merge request reports
Viewing commit
2633f10f
Prev
Next
Show latest version
3 files
+
158
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
2633f10f
Add SpecializedSegment to reduce duplicated code
· 2633f10f
Rainer Kartmann
authored
3 years ago
source/RobotAPI/libraries/armem/server/segment/SpecializedSegment.cpp
0 → 100644
+
79
−
0
Options
#include
"SpecializedSegment.h"
#include
<ArmarXCore/core/application/properties/PropertyDefinitionContainer.h>
#include
<ArmarXCore/core/application/properties/PluginAll.h>
#include
<ArmarXCore/core/exceptions/local/ExpressionException.h>
#include
<RobotAPI/libraries/aron/core/navigator/type/container/Object.h>
#include
<RobotAPI/libraries/armem/server/MemoryToIceAdapter.h>
namespace
armarx
::
armem
::
server
::
segment
{
SpecializedSegment
::
SpecializedSegment
(
server
::
MemoryToIceAdapter
&
iceMemory
,
aron
::
typenavigator
::
ObjectNavigatorPtr
aronType
,
const
std
::
string
&
defaultCoreSegmentName
,
int64_t
defaultMaxHistorySize
)
:
iceMemory
(
iceMemory
),
aronType
(
aronType
)
{
setDefaultCoreSegmentName
(
defaultCoreSegmentName
);
setDefaultMaxHistorySize
(
defaultMaxHistorySize
);
}
SpecializedSegment
::~
SpecializedSegment
()
{
}
void
SpecializedSegment
::
defineProperties
(
armarx
::
PropertyDefinitionsPtr
defs
,
const
std
::
string
&
prefix
)
{
defs
->
optional
(
properties
.
coreSegmentName
,
prefix
+
"seg.CoreSegmentName"
,
"Name of the "
+
properties
.
coreSegmentName
+
" core segment."
);
defs
->
optional
(
properties
.
maxHistorySize
,
prefix
+
"seg.MaxHistorySize"
,
"Maximal size of the "
+
properties
.
coreSegmentName
+
" entity histories (-1 for infinite)."
);
}
void
SpecializedSegment
::
init
()
{
ARMARX_CHECK_NOT_NULL
(
iceMemory
.
workingMemory
);
Logging
::
setTag
(
properties
.
coreSegmentName
+
" Core Segment"
);
ARMARX_INFO
<<
"Adding core segment '"
<<
properties
.
coreSegmentName
<<
"'"
;
coreSegment
=
&
iceMemory
.
workingMemory
->
addCoreSegment
(
properties
.
coreSegmentName
,
aronType
);
coreSegment
->
setMaxHistorySize
(
properties
.
maxHistorySize
);
}
std
::
mutex
&
SpecializedSegment
::
mutex
()
const
{
ARMARX_CHECK_NOT_NULL
(
coreSegment
);
return
coreSegment
->
mutex
();
}
void
SpecializedSegment
::
setDefaultCoreSegmentName
(
const
std
::
string
&
coreSegmentName
)
{
this
->
properties
.
coreSegmentName
=
coreSegmentName
;
}
void
SpecializedSegment
::
setDefaultMaxHistorySize
(
int64_t
maxHistorySize
)
{
this
->
properties
.
maxHistorySize
=
maxHistorySize
;
}
void
SpecializedSegment
::
setAronType
(
aron
::
typenavigator
::
ObjectNavigatorPtr
aronType
)
{
this
->
aronType
=
aronType
;
}
}
Loading