]> Dogcows Code - chaz/yoink/blob - src/stlplus/persistence/persistent_xref.hpp
archiving support for releases
[chaz/yoink] / src / stlplus / persistence / persistent_xref.hpp
1 #ifndef STLPLUS_PERSISTENT_XREF
2 #define STLPLUS_PERSISTENT_XREF
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 for cross-references to persistent objects
11
12 // A cross-reference is a pointer to an object that has definitely been dumped
13 // already by one of dump_pointer, dump_interface or dump_callback, i.e. by
14 // one of the dump routines for pointers to objects.
15
16 // These are typically used in data structures as back-pointers or pointers
17 // between nodes.
18
19 // For example, you may have a tree with cross links. Dump the tree as the
20 // primary data structure first, then dump the cross links as cross-references
21 // afterwards. The whole tree must be dumped before any cross-references to
22 // ensure that all cross-references are known to the persistence system.
23
24 // These functions will throw an exception if the cross-reference points to
25 // something not dumped before.
26
27 ////////////////////////////////////////////////////////////////////////////////
28 #include "persistence_fixes.hpp"
29 #include "persistent_contexts.hpp"
30
31 ////////////////////////////////////////////////////////////////////////////////
32
33 namespace stlplus
34 {
35
36 template<typename T>
37 void dump_xref(dump_context&, const T* const data)
38 throw(persistent_dump_failed);
39
40 template<typename T>
41 void restore_xref(restore_context&, T*& data)
42 throw(persistent_restore_failed);
43
44 } // end namespace stlplus
45
46 ////////////////////////////////////////////////////////////////////////////////
47 #include "persistent_xref.tpp"
48 #endif
This page took 0.030079 seconds and 4 git commands to generate.