X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fpersistence%2Fpersistent_smart_ptr.hpp;fp=src%2Fstlplus%2Fpersistence%2Fpersistent_smart_ptr.hpp;h=5f37725aad7239e431ebdf49b6f9bcd73729d6dc;hb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c;hp=0000000000000000000000000000000000000000;hpb=85783316365181491a3e3c0c63659972477cebba;p=chaz%2Fyoink diff --git a/src/stlplus/persistence/persistent_smart_ptr.hpp b/src/stlplus/persistence/persistent_smart_ptr.hpp new file mode 100644 index 0000000..5f37725 --- /dev/null +++ b/src/stlplus/persistence/persistent_smart_ptr.hpp @@ -0,0 +1,58 @@ +#ifndef STLPLUS_PERSISTENT_SMART_PTR +#define STLPLUS_PERSISTENT_SMART_PTR +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +// Persistence of STLplus smart_ptr + +//////////////////////////////////////////////////////////////////////////////// +#include "persistence_fixes.hpp" +#include "persistent_contexts.hpp" +#include "smart_ptr.hpp" + +//////////////////////////////////////////////////////////////////////////////// + +namespace stlplus +{ + + // smart_ptr - uses dump/restore_pointer on the contents + + template + void dump_smart_ptr(dump_context&, const smart_ptr& data, DE dump_element) + throw(persistent_dump_failed); + + template + void restore_smart_ptr(restore_context&, smart_ptr& data, RE restore_element) + throw(persistent_restore_failed); + + // smart_ptr_clone using the polymorphic callback approach - uses dump/restore_callback on the contents + + template + void dump_smart_ptr_clone_callback(dump_context&, const smart_ptr_clone& data) + throw(persistent_dump_failed); + + template + void restore_smart_ptr_clone_callback(restore_context&, smart_ptr_clone& data) + throw(persistent_restore_failed); + + // smart_ptr_clone using the interface approach - uses dump/restore_interface on the contents + + template + void dump_smart_ptr_clone_interface(dump_context&, const smart_ptr_clone& data) + throw(persistent_dump_failed); + + template + void restore_smart_ptr_clone_interface(restore_context&, smart_ptr_clone& data) + throw(persistent_restore_failed); + + // smart_ptr_nocopy is not made persistent because if it is uncopyable, it must be undumpable + +} // end namespace stlplus + + //////////////////////////////////////////////////////////////////////////////// +#include "persistent_smart_ptr.tpp" +#endif