Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Navigation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
Skills
Navigation
Commits
aa932d1c
Commit
aa932d1c
authored
2 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
json conversion
parent
e025bcb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!25
RT controller and simplification
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/armarx/navigation/core/json_conversions.cpp
+0
-25
0 additions, 25 deletions
source/armarx/navigation/core/json_conversions.cpp
source/armarx/navigation/core/json_conversions.h
+28
-9
28 additions, 9 deletions
source/armarx/navigation/core/json_conversions.h
with
28 additions
and
34 deletions
source/armarx/navigation/core/json_conversions.cpp
+
0
−
25
View file @
aa932d1c
...
...
@@ -20,28 +20,3 @@
*/
#include
"json_conversions.h"
#include
<RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h>
#include
<RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h>
namespace
armarx
::
navigation
::
core
{
void
arondto
::
to_json
(
nlohmann
::
json
&
j
,
const
Edge
&
bo
)
{
armarx
::
aron
::
data
::
writer
::
NlohmannJSONWriter
writer
;
j
=
bo
.
write
(
writer
);
}
void
arondto
::
from_json
(
const
nlohmann
::
json
&
j
,
Edge
&
bo
)
{
armarx
::
aron
::
data
::
reader
::
NlohmannJSONReader
reader
;
bo
.
read
(
reader
,
j
);
}
}
// namespace armarx::navigation::core
This diff is collapsed.
Click to expand it.
source/armarx/navigation/core/json_conversions.h
+
28
−
9
View file @
aa932d1c
...
...
@@ -23,14 +23,33 @@
#include
<SimoxUtility/json/json.hpp>
#include
<armarx/navigation/core/aron/Graph.aron.generated.h>
#include
"RobotAPI/libraries/aron/core/codegenerator/codewriter/cpp/AronGeneratedClass.h"
#include
"RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h"
#include
"RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h"
namespace
armarx
::
navigation
::
core
::
arondto
namespace
armarx
{
void
to_json
(
nlohmann
::
json
&
j
,
const
arondto
::
Edge
&
bo
);
void
from_json
(
const
nlohmann
::
json
&
j
,
arondto
::
Edge
&
bo
);
}
// namespace armarx::navigation::core::arondto
template
<
typename
AronDTO
>
void
from_json
(
const
nlohmann
::
json
&
j
,
AronDTO
&
dto
)
{
static_assert
(
std
::
is_base_of
<
armarx
::
aron
::
codegenerator
::
cpp
::
AronGeneratedClass
,
AronDTO
>::
value
);
armarx
::
aron
::
data
::
reader
::
NlohmannJSONReader
reader
;
dto
.
read
(
reader
,
j
);
}
template
<
typename
AronDTO
>
void
to_json
(
nlohmann
::
json
&
j
,
const
AronDTO
&
bo
)
{
static_assert
(
std
::
is_base_of
<
armarx
::
aron
::
codegenerator
::
cpp
::
AronGeneratedClass
,
AronDTO
>::
value
);
armarx
::
aron
::
data
::
writer
::
NlohmannJSONWriter
writer
;
j
=
bo
.
write
(
writer
);
}
}
// namespace armarx
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