persistence/persistent_vector.hpp
1: #ifndef STLPLUS_PERSISTENT_VECTOR
2: #define STLPLUS_PERSISTENT_VECTOR
3: ////////////////////////////////////////////////////////////////////////////////
4:
5: // Author: Andy Rushton
6: // Copyright: (c) Andy Rushton, 2007
7: // License: BSD License, see ../docs/license.html
8:
9: // Persistence of STL vector
10:
11: ////////////////////////////////////////////////////////////////////////////////
12: #include "persistence_fixes.hpp"
13: #include "persistent_contexts.hpp"
14: #include <vector>
15:
16: ////////////////////////////////////////////////////////////////////////////////
17:
18: namespace stlplus
19: {
20:
21: // vector
22:
23: template<typename T, typename D>
24: void dump_vector(dump_context&, const std::vector<T>& data, D dump_fn)
25: throw(persistent_dump_failed);
26:
27: template<typename T, typename R>
28: void restore_vector(restore_context&, std::vector<T>& data, R restore_fn)
29: throw(persistent_restore_failed);
30:
31: // specialism for vector<bool>
32:
33: void dump_vector_bool(dump_context&, const std::vector<bool>& data)
34: throw(persistent_dump_failed);
35:
36: void restore_vector_bool(restore_context&, std::vector<bool>& data)
37: throw(persistent_restore_failed);
38:
39: } // end namespace stlplus
40:
41: ////////////////////////////////////////////////////////////////////////////////
42: #include "persistent_vector.tpp"
43: #endif