From 8bec3821df2a4cc873207d635c3aa4f6caed459a Mon Sep 17 00:00:00 2001 From: John Rogers Date: Fri, 4 Feb 2011 20:48:16 +0000 Subject: [PATCH] Added serialization support for FastMap so that LieValues can be serialized. --- gtsam/base/FastMap.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gtsam/base/FastMap.h b/gtsam/base/FastMap.h index 965eeba38..b26dfe1c9 100644 --- a/gtsam/base/FastMap.h +++ b/gtsam/base/FastMap.h @@ -20,6 +20,7 @@ #include #include +#include namespace gtsam { @@ -30,6 +31,7 @@ namespace gtsam { * we've seen that the fast_pool_allocator can lead to speedups of several * percent. */ + template class FastMap : public std::map, boost::fast_pool_allocator > > { @@ -50,6 +52,16 @@ public: /** Copy constructor from the base map class */ FastMap(const Base& x) : Base(x) {} + private: + /** Serialization function */ + friend class boost::serialization::access; + template + void serialize(ARCHIVE & ar, const unsigned int version) { + //You are not supposed to do this: + boost::serialization::serialize(ar, *this, version); + //Instead you are supposed to do this: but it doesnt work + // ar & boost::serialization::base_object(*this); + } }; }