45 #include <tr1/unordered_map>
46 #include <boost/serialization/access.hpp>
47 #include <boost/serialization/base_object.hpp>
48 #include <boost/serialization/nvp.hpp>
49 #include <boost/serialization/split_member.hpp>
50 #include <boost/serialization/unordered_map.hpp>
62 std::tr1::hash<const Symbol*>,
63 std::equal_to<const Symbol*>,
77 explicit StdFrame(std::size_t initial_capacity = 15);
86 __attribute__((hot,fastcall))
94 std::size_t
size()
const;
96 friend class boost::serialization::access;
108 template<
class Archive>
109 void load(Archive& ar,
const unsigned int version);
111 template<
class Archive>
112 void save(Archive& ar,
const unsigned int version)
const;
114 template<
class Archive>
115 void serialize(Archive& ar,
const unsigned int version) {
116 boost::serialization::split_member(ar, *
this, version);
121 bool v_erase(
const Symbol* symbol);
127 template<
class Archive>
128 void StdFrame::load(Archive& ar,
const unsigned int version)
130 ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Frame);
131 size_t numberOfBindings;
132 ar >> BOOST_SERIALIZATION_NVP(numberOfBindings);
133 for (
size_t i = 0; i < numberOfBindings; ++i) {
137 ar >> boost::serialization::make_nvp(
"binding", *binding);
141 template<
class Archive>
142 void StdFrame::save(Archive& ar,
const unsigned int version)
const
144 ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(Frame);
145 size_t numberOfBindings =
size();
146 ar << BOOST_SERIALIZATION_NVP(numberOfBindings);
147 for (map::const_iterator it = m_map.begin();
148 it != m_map.end(); ++it) {
149 const Symbol* symbol = (*it).first;
150 const Binding&
binding = (*it).second;
152 ar << BOOST_SERIALIZATION_NVP(binding);
159 #endif // STDFRAME_HPP