Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
96101e97
Commit
96101e97
authored
Oct 19, 2020
by
Pierre Fernbach
Browse files
Add serialization to curve_constraints
parent
90b35dbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/curves/curve_constraint.h
View file @
96101e97
...
...
@@ -12,13 +12,14 @@
#define _CLASS_CURVE_CONSTRAINT
#include
"MathDefs.h"
#include
"serialization/archive.hpp"
#include
"serialization/eigen-matrix.hpp"
#include
<functional>
#include
<vector>
namespace
curves
{
template
<
typename
Point
>
struct
curve_constraints
{
struct
curve_constraints
:
serialization
::
Serializable
{
typedef
Point
point_t
;
curve_constraints
(
const
size_t
dim
=
3
)
:
init_vel
(
point_t
::
Zero
(
dim
)),
...
...
@@ -46,6 +47,22 @@ struct curve_constraints {
point_t
end_acc
;
point_t
end_jerk
;
size_t
dim_
;
// Serialization of the class
friend
class
boost
::
serialization
::
access
;
template
<
class
Archive
>
void
serialize
(
Archive
&
ar
,
const
unsigned
int
version
)
{
if
(
version
)
{
// Do something depending on version ?
}
ar
&
boost
::
serialization
::
make_nvp
(
"init_vel"
,
init_vel
);
ar
&
boost
::
serialization
::
make_nvp
(
"init_acc"
,
init_acc
);
ar
&
boost
::
serialization
::
make_nvp
(
"init_jerk"
,
init_jerk
);
ar
&
boost
::
serialization
::
make_nvp
(
"end_vel"
,
end_vel
);
ar
&
boost
::
serialization
::
make_nvp
(
"end_acc"
,
end_acc
);
ar
&
boost
::
serialization
::
make_nvp
(
"end_jerk"
,
end_jerk
);
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
}
};
}
// namespace curves
#endif //_CLASS_CUBICZEROVELACC
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment