Commit 78474d15 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Serialization] contact_phase: call the correct version of...

[Serialization] contact_phase: call the correct version of curve::register_type depending on archive version
parent fdbe81ea
...@@ -658,9 +658,15 @@ struct ContactPhaseTpl : public serialization::Serializable<ContactPhaseTpl<_Sca ...@@ -658,9 +658,15 @@ struct ContactPhaseTpl : public serialization::Serializable<ContactPhaseTpl<_Sca
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int /*version*/) { void serialize(Archive& ar, const unsigned int version) {
// ar& boost::serialization::make_nvp("placement", m_placement); // ar& boost::serialization::make_nvp("placement", m_placement);
curves::serialization::register_types<Archive>(ar); unsigned int curve_version; // Curves API version related to the archive multicontact-api API version
if(version <2){
curve_version = 0;
curve_version = 1;
curves::serialization::register_types<Archive>(ar, curve_version);
ar& boost::serialization::make_nvp("c_init", m_c_init); ar& boost::serialization::make_nvp("c_init", m_c_init);
ar& boost::serialization::make_nvp("dc_init", m_dc_init); ar& boost::serialization::make_nvp("dc_init", m_dc_init);
ar& boost::serialization::make_nvp("ddc_init", m_ddc_init); ar& boost::serialization::make_nvp("ddc_init", m_ddc_init);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment