comparison DEPENDENCIES/generic/include/boost/serialization/ephemeral.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 #ifndef BOOST_SERIALIZATION_EPHEMERAL_HPP
2 #define BOOST_SERIALIZATION_EPHEMERAL_HPP
3
4 // MS compatible compilers support
5 #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
7 # pragma once
8 #endif
9
10 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
11 // ephemeral_object.hpp: interface for serialization system.
12
13 // (C) Copyright 2007 Matthias Troyer.
14 // Use, modification and distribution is subject to the Boost Software
15 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 // See http://www.boost.org for updates, documentation, and revision history.
19
20 #include <utility>
21
22 #include <boost/config.hpp>
23 #include <boost/detail/workaround.hpp>
24 // supress noise
25 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
26 # pragma warning (disable : 4786) // too long name, harmless warning
27 #endif
28
29 #include <boost/mpl/integral_c.hpp>
30 #include <boost/mpl/integral_c_tag.hpp>
31
32 #include <boost/serialization/level.hpp>
33 #include <boost/serialization/tracking.hpp>
34 #include <boost/serialization/split_member.hpp>
35 #include <boost/serialization/base_object.hpp>
36 #include <boost/serialization/traits.hpp>
37 #include <boost/serialization/wrapper.hpp>
38
39 namespace boost {
40 namespace serialization {
41
42 template<class T>
43 struct ephemeral_object :
44 public wrapper_traits<ephemeral_object<T> >
45 {
46 explicit ephemeral_object(T& t) :
47 val(t)
48 {}
49
50 T & value() const {
51 return val;
52 }
53
54 const T & const_value() const {
55 return val;
56 }
57
58 template<class Archive>
59 void serialize(Archive &ar, const unsigned int) const
60 {
61 ar & val;
62 }
63
64 private:
65 T & val;
66 };
67
68 template<class T>
69 inline
70 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
71 const
72 #endif
73 ephemeral_object<T> ephemeral(const char * name, T & t){
74 return ephemeral_object<T>(name, t);
75 }
76
77 } // seralization
78 } // boost
79
80 #endif // BOOST_SERIALIZATION_EPHEMERAL_HPP