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