diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-29 15:35:20 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-29 15:35:20 -0500 |
commit | 08f65eeadc288ecde4b8fb281e477958c8ae7cd5 (patch) | |
tree | d16320cdc4a6b9b5c475dc83106368a81362ca3e /src | |
parent | ef7cab0830637828334fae0a9ad37d20f8e75176 (diff) | |
download | fork-ledger-08f65eeadc288ecde4b8fb281e477958c8ae7cd5.tar.gz fork-ledger-08f65eeadc288ecde4b8fb281e477958c8ae7cd5.tar.bz2 fork-ledger-08f65eeadc288ecde4b8fb281e477958c8ae7cd5.zip |
Allow serialization to be enabled again
Diffstat (limited to 'src')
-rw-r--r-- | src/scope.h | 2 | ||||
-rw-r--r-- | src/system.hh.in | 13 | ||||
-rw-r--r-- | src/xact.h | 15 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/scope.h b/src/scope.h index acaf7194..c43d73d6 100644 --- a/src/scope.h +++ b/src/scope.h @@ -483,7 +483,7 @@ public: #if defined(HAVE_BOOST_SERIALIZATION) protected: - explicit call_scope_t() { + explicit call_scope_t() : depth(0) { TRACE_CTOR(call_scope_t, ""); } diff --git a/src/system.hh.in b/src/system.hh.in index a38deb1f..552a591a 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -246,12 +246,19 @@ void serialize(Archive& ar, boost::intrusive_ptr<T>& ptr, const unsigned int) } } -template <class Archive, class T> -void serialize(Archive&, boost::function<T>&, const unsigned int) -{ +template <class Archive> +void serialize(Archive&, boost::any&, const unsigned int) { + // jww (2012-03-29): Should we really ignore any fields entirely? + // These occur inside value_t::storage_t::data's variant. } template <class Archive> +void serialize(Archive&, boost::blank&, const unsigned int) {} + +template <class Archive, class T> +void serialize(Archive&, boost::function<T>&, const unsigned int) {} + +template <class Archive> void serialize(Archive& ar, istream_pos_type& pos, const unsigned int) { ar & make_binary_object(&pos, sizeof(istream_pos_type)); @@ -168,6 +168,21 @@ public: bool _overwrite_existing) : tag_data(_tag_data), overwrite_existing(_overwrite_existing), apply_to_post(NULL) {} + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + deferred_tag_data_t() : apply_to_post(NULL) {} + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive& ar, const unsigned int /* version */) { + ar & tag_data; + ar & overwrite_existing; + ar & apply_to_post; + } +#endif // HAVE_BOOST_SERIALIZATION }; typedef std::list<deferred_tag_data_t> deferred_notes_list; |