diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-31 00:55:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-31 00:55:56 -0400 |
commit | a2cb549b1dff9024e3f700203e424e496b25fd91 (patch) | |
tree | 1c03e9eb6f649a1446021dfb2a5d93a697f81feb /src/scope.h | |
parent | 349fc5d175bc5c4acbc478b4d78c12dc507c4f58 (diff) | |
parent | a88a4c55b2b11d58d3b9e49bf785be42afe63510 (diff) | |
download | ledger-a2cb549b1dff9024e3f700203e424e496b25fd91.tar.gz ledger-a2cb549b1dff9024e3f700203e424e496b25fd91.tar.bz2 ledger-a2cb549b1dff9024e3f700203e424e496b25fd91.zip |
Merge branch 'next'
Diffstat (limited to 'src/scope.h')
-rw-r--r-- | src/scope.h | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/src/scope.h b/src/scope.h index 2539074e..fc330ba0 100644 --- a/src/scope.h +++ b/src/scope.h @@ -67,6 +67,16 @@ public: virtual void define(const string&, expr_t::ptr_op_t) {} virtual expr_t::ptr_op_t lookup(const string& name) = 0; + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive &, const unsigned int /* version */) {} +#endif // HAVE_BOOST_SERIALIZATION }; /** @@ -100,6 +110,19 @@ public: return parent->lookup(name); return NULL; } + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & boost::serialization::base_object<scope_t>(*this); + ar & parent; + } +#endif // HAVE_BOOST_SERIALIZATION }; /** @@ -127,6 +150,19 @@ public: virtual void define(const string& name, expr_t::ptr_op_t def); virtual expr_t::ptr_op_t lookup(const string& name); + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & boost::serialization::base_object<child_scope_t>(*this); + ar & symbols; + } +#endif // HAVE_BOOST_SERIALIZATION }; /** @@ -138,8 +174,6 @@ class call_scope_t : public child_scope_t { value_t args; - call_scope_t(); - public: explicit call_scope_t(scope_t& _parent) : child_scope_t(_parent) { TRACE_CTOR(call_scope_t, "scope_t&"); @@ -182,6 +216,21 @@ public: bool empty() const { return args.size() == 0; } + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + explicit call_scope_t() {} + + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & boost::serialization::base_object<child_scope_t>(*this); + ar & args; + } +#endif // HAVE_BOOST_SERIALIZATION }; /** @@ -215,6 +264,19 @@ public: return def; return child_scope_t::lookup(name); } + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & boost::serialization::base_object<child_scope_t>(*this); + ar & grandchild; + } +#endif // HAVE_BOOST_SERIALIZATION }; /** |