persistence/persistent_smart_ptr.hpp
1: #ifndef STLPLUS_PERSISTENT_SMART_PTR
2: #define STLPLUS_PERSISTENT_SMART_PTR
3: ////////////////////////////////////////////////////////////////////////////////
4:
5: // Author: Andy Rushton
6: // Copyright: (c) Southampton University 1999-2004
7: // (c) Andy Rushton 2004-2009
8: // License: BSD License, see ../docs/license.html
9:
10: // Persistence of STLplus smart_ptr
11:
12: ////////////////////////////////////////////////////////////////////////////////
13: #include "persistence_fixes.hpp"
14: #include "persistent_contexts.hpp"
15: #include "smart_ptr.hpp"
16:
17: ////////////////////////////////////////////////////////////////////////////////
18:
19: namespace stlplus
20: {
21:
22: // smart_ptr - uses dump/restore_pointer on the contents
23:
24: template<typename T, typename DE>
25: void dump_smart_ptr(dump_context&, const smart_ptr<T>& data, DE dump_element)
26: throw(persistent_dump_failed);
27:
28: template<typename T, typename RE>
29: void restore_smart_ptr(restore_context&, smart_ptr<T>& data, RE restore_element)
30: throw(persistent_restore_failed);
31:
32: // smart_ptr_clone using the polymorphic callback approach - uses dump/restore_callback on the contents
33:
34: template<typename T>
35: void dump_smart_ptr_clone_callback(dump_context&, const smart_ptr_clone<T>& data)
36: throw(persistent_dump_failed);
37:
38: template<typename T>
39: void restore_smart_ptr_clone_callback(restore_context&, smart_ptr_clone<T>& data)
40: throw(persistent_restore_failed);
41:
42: // smart_ptr_clone using the interface approach - uses dump/restore_interface on the contents
43:
44: template<typename T>
45: void dump_smart_ptr_clone_interface(dump_context&, const smart_ptr_clone<T>& data)
46: throw(persistent_dump_failed);
47:
48: template<typename T>
49: void restore_smart_ptr_clone_interface(restore_context&, smart_ptr_clone<T>& data)
50: throw(persistent_restore_failed);
51:
52: // smart_ptr_nocopy is not made persistent because if it is uncopyable, it must be undumpable
53:
54: } // end namespace stlplus
55:
56: ////////////////////////////////////////////////////////////////////////////////
57: #include "persistent_smart_ptr.tpp"
58: #endif