Pack required boost code together.
[xy_vsfilter.git] / src / thirdparty / boost_1_47_0 / boost / serialization / item_version_type.hpp
blobfa132c2bb490936b75856b93e1fac8743f4766ff
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>
17 namespace boost {
18 namespace serialization {
20 #if defined(_MSC_VER)
21 #pragma warning( push )
22 #pragma warning( disable : 4244 4267 )
23 #endif
25 class item_version_type {
26 private:
27 typedef unsigned int base_type;
28 base_type t;
29 public:
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_) :
36 t(t_.t)
38 item_version_type & operator=(item_version_type rhs){
39 t = rhs.t;
40 return *this;
42 // used for text output
43 operator base_type () const {
44 return t;
46 // used for text input
47 operator base_type & () {
48 return t;
50 bool operator==(const item_version_type & rhs) const {
51 return t == rhs.t;
53 bool operator<(const item_version_type & rhs) const {
54 return t < rhs.t;
58 #if defined(_MSC_VER)
59 #pragma warning( pop )
60 #endif
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