40 #ifndef GCNODE_PTRS11N_HPP
41 #define GCNODE_PTRS11N_HPP 1
43 #include <boost/mpl/eval_if.hpp>
44 #include <boost/mpl/identity.hpp>
119 typedef typename Ptr::type type;
127 template<
class Archive>
129 template <
typename Ptr>
130 static void invoke(Archive& ar, Ptr& ptr,
const char* name)
133 ar >> boost::serialization::make_nvp(name, target);
144 ptr =
static_cast<typename Payload<Ptr>::type*
>(target);
148 template<
class Archive>
150 template <
typename Ptr>
151 static void invoke(Archive& ar,
const Ptr& ptr,
const char* name)
154 =
static_cast<typename Payload<Ptr>::type*
>(ptr);
155 ar << boost::serialization::make_nvp(name, target);
185 template<
class Archive,
typename Ptr>
186 static void invoke(Archive& ar, Ptr& ptr,
const char* name)
188 using namespace boost::mpl;
189 typedef typename eval_if<
typename Archive::is_saving,
190 identity<Saver<Archive> >,
191 identity<Loader<Archive> > >::type typex;
201 #define GCNPTR_SERIALIZE(ar, name) \
202 GCNode::PtrS11n::invoke(ar, name, #name )
204 #endif // GCNODE_PTRS11N_HPP