8 #include <mrpt/io/CFileGZInputStream.h>
9 #include <mrpt/io/CFileGZOutputStream.h>
10 #include <mrpt/serialization/CArchive.h>
11 #include <mrpt/serialization/optional_serialization.h>
12 #include <mrpt/serialization/stl_serialization.h>
19 uint8_t LogRecord::serializeGetVersion()
const {
return 1; }
20 void LogRecord::serializeTo(mrpt::serialization::CArchive&
out)
const
24 out.WriteAs<
bool>(
true);
27 else {
out.WriteAs<
bool>(
false); }
30 out.WriteAs<
bool>(
true);
33 else {
out.WriteAs<
bool>(
false); }
40 void LogRecord::serializeFrom(
41 mrpt::serialization::CArchive& in, uint8_t version)
50 if (in.ReadAs<
bool>())
55 if (in.ReadAs<
bool>())
57 pcLocal = metric_map_t::Create();
71 MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version);
79 auto f = mrpt::io::CFileGZOutputStream(fileName);
80 if (!
f.is_open())
return false;
82 auto arch = mrpt::serialization::archiveFrom(
f);
87 catch (
const std::exception& e)
89 std::cerr <<
"[LogRecord::save_to_file] Error: " << e.what();
98 auto f = mrpt::io::CFileGZInputStream(fileName);
99 if (!
f.is_open())
return false;
101 auto arch = mrpt::serialization::archiveFrom(
f);
106 catch (
const std::exception& e)
108 std::cerr <<
"[LogRecord::save_to_file] Error: " << e.what();
116 mrpt::serialization::CArchive&
out)
const
123 mrpt::serialization::CArchive& in)
125 const auto readVersion = in.ReadAs<uint8_t>();
127 in >> optimalPose >> pairings;
131 mrpt::serialization::CArchive&
out,