I am continuing my structure serialization ...
Seems I do not get something with pointers ... I have followed the
"demo.cpp" example and tried to do the same as they are doing for pointers but I
get an exception when trying to relaod my structure !
Hope someone can help me ....
-Save a Particle structure.
-this sensorReading has a pointer to a Sensor class (only containing a
string)
When I save(serialize) the particle, the file "out.txt" contains the
following text:
22 serialization::archive 6 0 0 0 0 1.1000000000000001 4.4000000000000004 0
2.1000000000000001 8.4000000000000004 0 3 12.699999999999999 8.5 6 0 0 35 3 1 0
0 11 Sensor Name
wheelchair@wheelchair-laptop:~/playerstage/boostTest$
g++ simple_RangeReading.cpp -o simple
-lboost_serialization
/usr/local/include/boost/archive/detail/iserializer.hpp:
In static member function ‘static void
boost::archive::detail::load_pointer_type<Archive>::invoke(Archive&,
Tptr&) [with Tptr = const Sensor*, Archive =
boost::archive::text_iarchive]’:
/usr/local/include/boost/archive/detail/iserializer.hpp:554:
instantiated from ‘void boost::archive::load(Archive&, T&) [with Archive
= boost::archive::text_iarchive, T = const
Sensor*]’
/usr/local/include/boost/archive/detail/common_iarchive.hpp:61:
instantiated from ‘void
boost::archive::detail::common_iarchive<Archive>::load_override(T&,
int) [with T = const Sensor*, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/basic_text_iarchive.hpp:62:
instantiated from ‘void
boost::archive::basic_text_iarchive<Archive>::load_override(T&, int)
[with T = const Sensor*, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/text_iarchive.hpp:66:
instantiated from ‘void
boost::archive::text_iarchive_impl<Archive>::load_override(T&, int)
[with T = const Sensor*, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/interface_iarchive.hpp:61:
instantiated from ‘Archive&
boost::archive::detail::interface_iarchive<Archive>::operator>>(T&)
[with T = const Sensor*, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/interface_iarchive.hpp:68:
instantiated from ‘Archive&
boost::archive::detail::interface_iarchive<Archive>::operator&(T&)
[with T = const Sensor*, Archive =
boost::archive::text_iarchive]’
simple_RangeReading.cpp:279: instantiated
from ‘void SensorReading::serialize(Archive&, unsigned int) [with Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/serialization/access.hpp:109:
instantiated from ‘static void
boost::serialization::access::serialize(Archive&, T&, unsigned int)
[with Archive = boost::archive::text_iarchive, T =
SensorReading]’
/usr/local/include/boost/serialization/serialization.hpp:74:
instantiated from ‘void boost::serialization::serialize(Archive&, T&,
unsigned int) [with Archive = boost::archive::text_iarchive, T =
SensorReading]’
/usr/local/include/boost/serialization/serialization.hpp:133:
instantiated from ‘void boost::serialization::serialize_adl(Archive&,
T&, unsigned int) [with Archive = boost::archive::text_iarchive, T =
SensorReading]’
/usr/local/include/boost/archive/detail/iserializer.hpp:173:
instantiated from ‘void boost::archive::detail::iserializer<Archive,
T>::load_object_data(boost::archive::detail::basic_iarchive&, void*,
unsigned int) const [with Archive = boost::archive::text_iarchive, T =
SensorReading]’
simple_RangeReading.cpp:424: instantiated from
here
/usr/local/include/boost/archive/detail/iserializer.hpp:486: error:
reinterpret_cast from type ‘const Sensor**’ to type ‘void**’ casts away
constness
/usr/local/include/boost/archive/detail/iserializer.hpp:489: error:
no matching function for call to
‘boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::pointer_tweak(const
boost::serialization::extended_type_info&, const Sensor*&, const
Sensor&)’
/usr/local/include/boost/archive/detail/iserializer.hpp: In
member function ‘void boost::archive::detail::pointer_iserializer<Archive,
T>::load_object_ptr(boost::archive::detail::basic_iarchive&, void*&,
unsigned int) const [with Archive = boost::archive::text_iarchive, T = const
Sensor]’:
simple_RangeReading.cpp:424: instantiated from
here
/usr/local/include/boost/archive/detail/iserializer.hpp:286: error:
invalid conversion from ‘const void*’ to
‘void*’
/usr/local/include/boost/archive/detail/iserializer.hpp:294: error:
invalid conversion from ‘const void*’ to
‘void*’
/usr/local/include/boost/archive/detail/iserializer.hpp:294: error:
initializing argument 1 of ‘void
boost::archive::detail::basic_iarchive::next_object_pointer(void*)’
/usr/local/include/boost/serialization/access.hpp:
In static member function ‘static void
boost::serialization::access::serialize(Archive&, T&, unsigned int)
[with Archive = boost::archive::text_iarchive, T = const
Sensor]’:
/usr/local/include/boost/serialization/serialization.hpp:74:
instantiated from ‘void boost::serialization::serialize(Archive&, T&,
unsigned int) [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/serialization/serialization.hpp:133:
instantiated from ‘void boost::serialization::serialize_adl(Archive&,
T&, unsigned int) [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/archive/detail/iserializer.hpp:173:
instantiated from ‘void boost::archive::detail::iserializer<Archive,
T>::load_object_data(boost::archive::detail::basic_iarchive&, void*,
unsigned int) const [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
simple_RangeReading.cpp:424: instantiated from
here
/usr/local/include/boost/serialization/access.hpp:109: error: passing
‘const Sensor’ as ‘this’ argument of ‘void Sensor::serialize(Archive&,
unsigned int) [with Archive = boost::archive::text_iarchive]’ discards
qualifiers
/usr/local/include/boost/serialization/access.hpp: In static
member function ‘static void boost::serialization::access::construct(T*) [with T
= const
Sensor]’:
/usr/local/include/boost/serialization/serialization.hpp:98:
instantiated from ‘void boost::serialization::load_construct_data(Archive&,
T*, unsigned int) [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/serialization/serialization.hpp:163:
instantiated from ‘void
boost::serialization::load_construct_data_adl(Archive&, T*, unsigned int)
[with Archive = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/archive/detail/iserializer.hpp:295:
instantiated from ‘void boost::archive::detail::pointer_iserializer<Archive,
T>::load_object_ptr(boost::archive::detail::basic_iarchive&, void*&,
unsigned int) const [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
simple_RangeReading.cpp:424: instantiated from
here
/usr/local/include/boost/serialization/access.hpp:123: error: invalid
conversion from ‘const void*’ to
‘void*’
/usr/local/include/boost/serialization/access.hpp:123: error:
initializing argument 2 of ‘void* operator new(size_t,
void*)’
/usr/local/include/boost/archive/detail/check.hpp: In function ‘void
boost::archive::detail::check_const_loading() [with T = const
Sensor]’:
/usr/local/include/boost/archive/detail/iserializer.hpp:539:
instantiated from ‘void boost::archive::load(Archive&, T&) [with Archive
= boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/archive/detail/common_iarchive.hpp:61:
instantiated from ‘void
boost::archive::detail::common_iarchive<Archive>::load_override(T&,
int) [with T = const Sensor, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/basic_text_iarchive.hpp:62:
instantiated from ‘void
boost::archive::basic_text_iarchive<Archive>::load_override(T&, int)
[with T = const Sensor, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/text_iarchive.hpp:66:
instantiated from ‘void
boost::archive::text_iarchive_impl<Archive>::load_override(T&, int)
[with T = const Sensor, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/interface_iarchive.hpp:61:
instantiated from ‘Archive&
boost::archive::detail::interface_iarchive<Archive>::operator>>(T&)
[with T = const Sensor, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/serialization/nvp.hpp:87:
instantiated from ‘void boost::serialization::nvp<T>::load(Archivex&,
unsigned int) [with Archivex = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/serialization/access.hpp:101:
instantiated from ‘static void
boost::serialization::access::member_load(Archive&, T&, unsigned int)
[with Archive = boost::archive::text_iarchive, T =
boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/serialization/split_member.hpp:54:
instantiated from ‘static void
boost::serialization::detail::member_loader<Archive,
T>::invoke(Archive&, T&, unsigned int) [with Archive =
boost::archive::text_iarchive, T = boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/serialization/split_member.hpp:69:
instantiated from ‘void boost::serialization::split_member(Archive&, T&,
unsigned int) [with Archive = boost::archive::text_iarchive, T =
boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/serialization/nvp.hpp:89:
instantiated from ‘void
boost::serialization::nvp<T>::serialize(Archive&, unsigned int) [with
Archive = boost::archive::text_iarchive, T = const
Sensor]’
/usr/local/include/boost/serialization/access.hpp:109:
instantiated from ‘static void
boost::serialization::access::serialize(Archive&, T&, unsigned int)
[with Archive = boost::archive::text_iarchive, T =
boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/serialization/serialization.hpp:74:
instantiated from ‘void boost::serialization::serialize(Archive&, T&,
unsigned int) [with Archive = boost::archive::text_iarchive, T =
boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/serialization/serialization.hpp:133:
instantiated from ‘void boost::serialization::serialize_adl(Archive&,
T&, unsigned int) [with Archive = boost::archive::text_iarchive, T =
boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/archive/detail/iserializer.hpp:349:
instantiated from ‘static void
boost::archive::detail::load_non_pointer_type<Archive>::load_only::invoke(Archive&,
const T&) [with T = boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/iserializer.hpp:415:
instantiated from ‘static void
boost::archive::detail::load_non_pointer_type<Archive>::invoke(Archive&,
T&) [with T = const boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/iserializer.hpp:554:
instantiated from ‘void boost::archive::load(Archive&, T&) [with Archive
= boost::archive::text_iarchive, T = const boost::serialization::nvp<const
Sensor>]’
/usr/local/include/boost/archive/detail/common_iarchive.hpp:61:
instantiated from ‘void
boost::archive::detail::common_iarchive<Archive>::load_override(T&,
int) [with T = const boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/basic_text_iarchive.hpp:62:
instantiated from ‘void
boost::archive::basic_text_iarchive<Archive>::load_override(T&, int)
[with T = const boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/text_iarchive.hpp:66:
instantiated from ‘void
boost::archive::text_iarchive_impl<Archive>::load_override(T&, int)
[with T = const boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/interface_iarchive.hpp:61:
instantiated from ‘Archive&
boost::archive::detail::interface_iarchive<Archive>::operator>>(T&)
[with T = const boost::serialization::nvp<const Sensor>, Archive =
boost::archive::text_iarchive]’
/usr/local/include/boost/archive/detail/iserializer.hpp:307:
instantiated from ‘void boost::archive::detail::pointer_iserializer<Archive,
T>::load_object_ptr(boost::archive::detail::basic_iarchive&, void*&,
unsigned int) const [with Archive = boost::archive::text_iarchive, T = const
Sensor]’
simple_RangeReading.cpp:424: instantiated from
here
/usr/local/include/boost/archive/detail/check.hpp:162: error: invalid
application of ‘sizeof’ to incomplete type
‘boost::STATIC_ASSERTION_FAILURE<false>’
/usr/local/include/boost/archive/detail/check.hpp:162:
error: invalid application of ‘sizeof’ to incomplete type
‘boost::STATIC_ASSERTION_FAILURE<false>’
wheelchair@wheelchair-laptop:~/playerstage/boostTest$
/** The pose of the robot at the previous time frame (used for
computing thr odometry displacements) */
OrientedPoint
previousPose;