1 #ifndef STLPLUS_PERSISTENT_XREF
2 #define STLPLUS_PERSISTENT_XREF
3 ////////////////////////////////////////////////////////////////////////////////
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
10 // Persistence for cross-references to persistent objects
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.
16 // These are typically used in data structures as back-pointers or pointers
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.
24 // These functions will throw an exception if the cross-reference points to
25 // something not dumped before.
27 ////////////////////////////////////////////////////////////////////////////////
28 #include "persistence_fixes.hpp"
29 #include "persistent_contexts.hpp"
31 ////////////////////////////////////////////////////////////////////////////////
37 void dump_xref(dump_context
&, const T
* const data
)
38 throw(persistent_dump_failed
);
41 void restore_xref(restore_context
&, T
*& data
)
42 throw(persistent_restore_failed
);
44 } // end namespace stlplus
46 ////////////////////////////////////////////////////////////////////////////////
47 #include "persistent_xref.tpp"