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
loco-3d
Multicontact-api
Commits
7c455b65
Commit
7c455b65
authored
May 18, 2020
by
Pierre Fernbach
Browse files
Serialization: add macro to define API version
parent
074e3ab1
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/multicontact-api/scenario/contact-model.hpp
View file @
7c455b65
...
...
@@ -140,4 +140,6 @@ struct ContactModelTpl : public serialization::Serializable<ContactModelTpl<_Sca
}
// namespace scenario
}
// namespace multicontact_api
DEFINE_CLASS_TEMPLATE_VERSION
(
typename
Scalar
,
multicontact_api
::
scenario
::
ContactModelTpl
<
Scalar
>
)
#endif // ifndef __multicontact_api_scenario_contact_model_planar_hpp__
include/multicontact-api/scenario/contact-patch.hpp
View file @
7c455b65
...
...
@@ -88,4 +88,6 @@ struct ContactPatchTpl : public serialization::Serializable<ContactPatchTpl<_Sca
}
// namespace scenario
}
// namespace multicontact_api
DEFINE_CLASS_TEMPLATE_VERSION
(
typename
Scalar
,
multicontact_api
::
scenario
::
ContactPatchTpl
<
Scalar
>
)
#endif // __multicontact_api_scenario_contact_patch_hpp__
include/multicontact-api/scenario/contact-phase.hpp
View file @
7c455b65
...
...
@@ -699,4 +699,6 @@ struct ContactPhaseTpl : public serialization::Serializable<ContactPhaseTpl<_Sca
}
// namespace scenario
}
// namespace multicontact_api
DEFINE_CLASS_TEMPLATE_VERSION
(
typename
Scalar
,
multicontact_api
::
scenario
::
ContactPhaseTpl
<
Scalar
>
)
#endif // CONTACTPHASE_HPP
include/multicontact-api/scenario/contact-sequence.hpp
View file @
7c455b65
...
...
@@ -1248,4 +1248,7 @@ struct ContactSequenceTpl : public serialization::Serializable<ContactSequenceTp
}
// namespace scenario
}
// namespace multicontact_api
DEFINE_CLASS_TEMPLATE_VERSION
(
typename
Scalar
,
multicontact_api
::
scenario
::
ContactSequenceTpl
<
Scalar
>
)
#endif // __multicontact_api_scenario_contact_sequence_hpp__
include/multicontact-api/serialization/archive.hpp
View file @
7c455b65
...
...
@@ -13,6 +13,22 @@
#include
<boost/archive/xml_oarchive.hpp>
#include
<boost/archive/binary_iarchive.hpp>
#include
<boost/archive/binary_oarchive.hpp>
#include
<boost/serialization/version.hpp>
const
unsigned
int
API_VERSION
=
1
;
// must be increased everytime the save() method of a class is modified
// Macro used to define the serialization version of a templated class
#define DEFINE_CLASS_TEMPLATE_VERSION(Template, Type) \
namespace boost { \
namespace serialization { \
template <Template> \
struct version<Type> { \
static constexpr unsigned int value = API_VERSION; \
}; \
template <Template> \
constexpr unsigned int version<Type>::value; \
} \
}
namespace
multicontact_api
{
namespace
serialization
{
...
...
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