]> Dogcows Code - chaz/yoink/blob - src/stlplus/persistence/persistent_enum.tpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / persistence / persistent_enum.tpp
1 ////////////////////////////////////////////////////////////////////////////////
2
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
7
8 ////////////////////////////////////////////////////////////////////////////////
9
10 #include "persistent_int.hpp"
11
12 namespace stlplus
13 {
14
15 ////////////////////////////////////////////////////////////////////////////////
16 // enumeration types
17
18 template<typename T>
19 void dump_enum(dump_context& context, const T& data)
20 throw(persistent_dump_failed)
21 {
22 dump_unsigned(context,(unsigned)data);
23 }
24
25 template<typename T>
26 void restore_enum(restore_context& context, T& data)
27 throw(persistent_restore_failed)
28 {
29 unsigned value = 0;
30 restore_unsigned(context, value);
31 data = (T)value;
32 }
33
34 ////////////////////////////////////////////////////////////////////////////////
35
36 } // end namespace stlplus
This page took 0.030165 seconds and 4 git commands to generate.