1 #ifndef BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
2 #define BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
4 // (C) Copyright 2010 Robert Ramey
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/cstdint.hpp> // uint_least8_t
10 #include <boost/integer_traits.hpp>
11 #include <boost/serialization/level.hpp>
12 #include <boost/serialization/is_bitwise_serializable.hpp>
14 // fixes broken example build on x86_64-linux-gnu-gcc-4.6.0
15 #include <boost/assert.hpp>
18 namespace serialization
{
21 #pragma warning( push )
22 #pragma warning( disable : 4244 4267 )
25 class item_version_type
{
27 typedef unsigned int base_type
;
30 // should be private - but MPI fails if it's not!!!
31 item_version_type(): t(0) {};
32 explicit item_version_type(const unsigned int t_
) : t(t_
){
33 BOOST_ASSERT(t_
<= boost::integer_traits
<base_type
>::const_max
);
35 item_version_type(const item_version_type
& t_
) :
38 item_version_type
& operator=(item_version_type rhs
){
42 // used for text output
43 operator base_type () const {
46 // used for text input
47 operator base_type
& () {
50 bool operator==(const item_version_type
& rhs
) const {
53 bool operator<(const item_version_type
& rhs
) const {
59 #pragma warning( pop )
62 } } // end namespace boost::serialization
64 BOOST_IS_BITWISE_SERIALIZABLE(item_version_type
)
66 BOOST_CLASS_IMPLEMENTATION(item_version_type
, primitive_type
)
68 #endif //BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP