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
Lennard Hofmann
RobotAPI
Commits
7bb2566c
Commit
7bb2566c
authored
1 year ago
by
Fabian Tërnava
Browse files
Options
Downloads
Patches
Plain Diff
fix properties of simpleWriter if no registerPropertyDefinitions is used
parent
93da6533
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/armem/client/util/SimpleWriterBase.cpp
+21
-8
21 additions, 8 deletions
...RobotAPI/libraries/armem/client/util/SimpleWriterBase.cpp
source/RobotAPI/libraries/armem/client/util/SimpleWriterBase.h
+2
-1
2 additions, 1 deletion
...e/RobotAPI/libraries/armem/client/util/SimpleWriterBase.h
with
23 additions
and
9 deletions
source/RobotAPI/libraries/armem/client/util/SimpleWriterBase.cpp
+
21
−
8
View file @
7bb2566c
...
@@ -16,25 +16,28 @@ namespace armarx::armem::client::util
...
@@ -16,25 +16,28 @@ namespace armarx::armem::client::util
const
std
::
string
prefix
=
propertyPrefix
();
const
std
::
string
prefix
=
propertyPrefix
();
props
=
defaultProperties
();
if
(
not
props
.
has_value
())
{
props
=
defaultProperties
();
}
def
->
optional
(
props
.
memoryName
,
prefix
+
"Memory"
);
def
->
optional
(
props
->
memoryName
,
prefix
+
"Memory"
);
def
->
optional
(
props
.
coreSegmentName
,
prefix
+
"CoreSegment"
);
def
->
optional
(
props
->
coreSegmentName
,
prefix
+
"CoreSegment"
);
// TODO(fabian.reister): this might also be part of the subclass
// TODO(fabian.reister): this might also be part of the subclass
// if the provider name has to be derived from e.g. the component name
// if the provider name has to be derived from e.g. the component name
def
->
optional
(
props
.
providerName
,
prefix
+
"Provider"
,
"Name of this provider"
);
def
->
optional
(
props
->
providerName
,
prefix
+
"Provider"
,
"Name of this provider"
);
}
}
void
void
SimpleWriterBase
::
connect
(
armarx
::
armem
::
client
::
MemoryNameSystem
&
mns
)
SimpleWriterBase
::
connect
(
armarx
::
armem
::
client
::
MemoryNameSystem
&
mns
)
{
{
// Wait for the memory to become available and add it as dependency.
// Wait for the memory to become available and add it as dependency.
ARMARX_IMPORTANT
<<
"SimpleWriterBase: Waiting for memory '"
<<
prop
s
.
memoryName
<<
"' ..."
;
ARMARX_IMPORTANT
<<
"SimpleWriterBase: Waiting for memory '"
<<
prop
erties
()
.
memoryName
<<
"' ..."
;
try
try
{
{
memoryWriterClient
=
mns
.
useWriter
(
MemoryID
().
withMemoryName
(
prop
s
.
memoryName
));
memoryWriterClient
=
mns
.
useWriter
(
MemoryID
().
withMemoryName
(
prop
erties
()
.
memoryName
));
ARMARX_IMPORTANT
<<
"SimpleWriterBase: Connected to memory '"
<<
prop
s
.
memoryName
ARMARX_IMPORTANT
<<
"SimpleWriterBase: Connected to memory '"
<<
prop
erties
()
.
memoryName
<<
"'"
;
<<
"'"
;
}
}
catch
(
const
armem
::
error
::
CouldNotResolveMemoryServer
&
e
)
catch
(
const
armem
::
error
::
CouldNotResolveMemoryServer
&
e
)
...
@@ -53,7 +56,17 @@ namespace armarx::armem::client::util
...
@@ -53,7 +56,17 @@ namespace armarx::armem::client::util
const
SimpleWriterBase
::
Properties
&
const
SimpleWriterBase
::
Properties
&
SimpleWriterBase
::
properties
()
const
SimpleWriterBase
::
properties
()
const
{
{
return
props
;
if
(
not
props
.
has_value
())
{
const_cast
<
std
::
optional
<
Properties
>&>
(
props
)
=
defaultProperties
();
}
return
props
.
value
();
}
void
SimpleWriterBase
::
setProperties
(
const
Properties
&
p
)
{
props
=
p
;
}
}
}
// namespace armarx::armem::client::util
}
// namespace armarx::armem::client::util
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/armem/client/util/SimpleWriterBase.h
+
2
−
1
View file @
7bb2566c
...
@@ -54,6 +54,7 @@ namespace armarx::armem::client::util
...
@@ -54,6 +54,7 @@ namespace armarx::armem::client::util
};
};
const
Properties
&
properties
()
const
;
const
Properties
&
properties
()
const
;
void
setProperties
(
const
Properties
&
p
);
virtual
std
::
string
propertyPrefix
()
const
=
0
;
virtual
std
::
string
propertyPrefix
()
const
=
0
;
virtual
Properties
defaultProperties
()
const
=
0
;
virtual
Properties
defaultProperties
()
const
=
0
;
...
@@ -62,7 +63,7 @@ namespace armarx::armem::client::util
...
@@ -62,7 +63,7 @@ namespace armarx::armem::client::util
private
:
private
:
Properties
props
;
std
::
optional
<
Properties
>
props
;
armem
::
client
::
Writer
memoryWriterClient
;
armem
::
client
::
Writer
memoryWriterClient
;
};
};
...
...
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