/usr/include/boost/serialization
NameSizeModeActions
detail/-0755rm
access.hpp43740644editdlrm
archive_input_unordered_map.hpp27940644editdlrm
archive_input_unordered_set.hpp22750644editdlrm
array.hpp14430644editdlrm
array_optimization.hpp13810644editdlrm
array_wrapper.hpp32710644editdlrm
assume_abstract.hpp19350644editdlrm
base_object.hpp30080644editdlrm
binary_object.hpp22950644editdlrm
bitset.hpp19530644editdlrm
boost_array.hpp9490644editdlrm
boost_unordered_map.hpp42720644editdlrm
boost_unordered_set.hpp40440644editdlrm
collections_load_imp.hpp29170644editdlrm
collections_save_imp.hpp23060644editdlrm
collection_size_type.hpp17640644editdlrm
collection_size_type copy.hpp34150644editdlrm
collection_traits.hpp36790644editdlrm
complex.hpp22190644editdlrm
config.hpp27340644editdlrm
deque.hpp23240644editdlrm
export.hpp82150644editdlrm
extended_type_info.hpp36040644editdlrm
extended_type_info_no_rtti.hpp63670644editdlrm
extended_type_info_typeid.hpp56610644editdlrm
factory.hpp40990644editdlrm
force_include.hpp20730644editdlrm
forward_list.hpp38650644editdlrm
hash_collections_load_imp.hpp26860644editdlrm
hash_collections_save_imp.hpp34350644editdlrm
hash_map.hpp63130644editdlrm
hash_set.hpp58840644editdlrm
is_bitwise_serializable.hpp13990644editdlrm
item_version_type.hpp18560644editdlrm
level.hpp36210644editdlrm
level_enum.hpp21400644editdlrm
library_version_type.hpp20450644editdlrm
list.hpp24850644editdlrm
map.hpp44470644editdlrm
nvp.hpp35380644editdlrm
optional.hpp32010644editdlrm
priority_queue.hpp24130644editdlrm
queue.hpp20940644editdlrm
scoped_ptr.hpp15520644editdlrm
serialization.hpp46780644editdlrm
set.hpp42840644editdlrm
shared_ptr.hpp98210644editdlrm
shared_ptr_132.hpp73700644editdlrm
shared_ptr_helper.hpp70470644editdlrm
singleton.hpp76030644editdlrm
slist.hpp48280644editdlrm
smart_cast.hpp89440644editdlrm
split_free.hpp27340644editdlrm
split_member.hpp26400644editdlrm
stack.hpp20930644editdlrm
state_saver.hpp26910644editdlrm
static_warning.hpp38440644editdlrm
string.hpp9760644editdlrm
strong_typedef.hpp30840644editdlrm
throw_exception.hpp9470644editdlrm
tracking.hpp39900644editdlrm
tracking_enum.hpp12270644editdlrm
traits.hpp20170644editdlrm
type_info_implementation.hpp26210644editdlrm
unique_ptr.hpp19710644editdlrm
unordered_collections_load_imp.hpp24380644editdlrm
unordered_collections_save_imp.hpp29930644editdlrm
unordered_map.hpp41640644editdlrm
unordered_set.hpp40240644editdlrm
utility.hpp17890644editdlrm
valarray.hpp27540644editdlrm
variant.hpp51220644editdlrm
vector.hpp69240644editdlrm
vector_135.hpp9420644editdlrm
version.hpp42910644editdlrm
void_cast.hpp87470644editdlrm
void_cast_fwd.hpp11870644editdlrm
weak_ptr.hpp24370644editdlrm
wrapper.hpp19070644editdlrm
Edit: /usr/include/boost/serialization/shared_ptr_helper.hpp (7047B)
#ifndef BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP #define BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // shared_ptr_helper.hpp: serialization for boost shared pointern // (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #include #include #include #include // NULL #include #include #include #include #include #include #include #include #include namespace boost_132 { template class shared_ptr; } namespace boost { namespace serialization { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS template class SPT > void load( Archive & ar, SPT< class U > &t, const unsigned int file_version ); #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // a common class for holding various types of shared pointers template class SPT> class shared_ptr_helper { typedef std::map< const void *, // address of object SPT // address shared ptr to single instance > object_shared_pointer_map; // list of shared_pointers create accessable by raw pointer. This // is used to "match up" shared pointers loaded at different // points in the archive. Note, we delay construction until // it is actually used since this is by default included as // a "mix-in" even if shared_ptr isn't used. object_shared_pointer_map * m_o_sp; struct null_deleter { void operator()(void const *) const {} }; #if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \ || defined(BOOST_MSVC) \ || defined(__SUNPRO_CC) public: #else template friend void boost::serialization::load( Archive & ar, SPT< U > &t, const unsigned int file_version ); #endif #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP // list of loaded pointers. This is used to be sure that the pointers // stay around long enough to be "matched" with other pointers loaded // by the same archive. These are created with a "null_deleter" so that // when this list is destroyed - the underlaying raw pointers are not // destroyed. This has to be done because the pointers are also held by // new system which is disjoint from this set. This is implemented // by a change in load_construct_data below. It makes this file suitable // only for loading pointers into a 1.33 or later boost system. std::list > * m_pointers_132; void append(const boost_132::shared_ptr & t){ if(NULL == m_pointers_132) m_pointers_132 = new std::list >; m_pointers_132->push_back(t); } #endif struct non_polymorphic { template static const boost::serialization::extended_type_info * get_object_type(U & ){ return & boost::serialization::singleton< typename boost::serialization::type_info_implementation< U >::type >::get_const_instance(); } }; struct polymorphic { template static const boost::serialization::extended_type_info * get_object_type(U & u){ return boost::serialization::singleton< typename boost::serialization::type_info_implementation< U >::type >::get_const_instance().get_derived_extended_type_info(u); } }; public: template void reset(SPT< T > & s, T * t){ if(NULL == t){ s.reset(); return; } const boost::serialization::extended_type_info * this_type = & boost::serialization::type_info_implementation< T >::type ::get_const_instance(); // get pointer to the most derived object's eti. This is effectively // the object type identifer typedef typename mpl::if_< is_polymorphic< T >, polymorphic, non_polymorphic >::type type; const boost::serialization::extended_type_info * true_type = type::get_object_type(*t); // note:if this exception is thrown, be sure that derived pointern // is either registered or exported. if(NULL == true_type) boost::serialization::throw_exception( boost::archive::archive_exception( boost::archive::archive_exception::unregistered_class, this_type->get_debug_info() ) ); // get void pointer to the most derived type // this uniquely identifies the object referred to // oid = "object identifier" const void * oid = void_downcast( *true_type, *this_type, t ); if(NULL == oid) boost::serialization::throw_exception( boost::archive::archive_exception( boost::archive::archive_exception::unregistered_cast, true_type->get_debug_info(), this_type->get_debug_info() ) ); // make tracking array if necessary if(NULL == m_o_sp) m_o_sp = new object_shared_pointer_map; typename object_shared_pointer_map::iterator i = m_o_sp->find(oid); // if it's a new object if(i == m_o_sp->end()){ s.reset(t); std::pair result; result = m_o_sp->insert(std::make_pair(oid, s)); BOOST_ASSERT(result.second); } // if the object has already been seen else{ s = SPT(i->second, t); } } shared_ptr_helper() : m_o_sp(NULL) #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP , m_pointers_132(NULL) #endif {} virtual ~shared_ptr_helper(){ if(NULL != m_o_sp) delete m_o_sp; #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP if(NULL != m_pointers_132) delete m_pointers_132; #endif } }; } // namespace serialization } // namespace boost #endif // BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP