File indexing completed on 2025-12-15 10:08:13
0001 #ifndef BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
0002 #define BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/cstdint.hpp> // uint_least8_t
0010 #include <boost/integer_traits.hpp>
0011 #include <boost/serialization/level.hpp>
0012 #include <boost/serialization/is_bitwise_serializable.hpp>
0013
0014
0015 #include <boost/assert.hpp>
0016
0017 namespace boost {
0018 namespace serialization {
0019
0020 #if defined(_MSC_VER)
0021 #pragma warning( push )
0022 #pragma warning( disable : 4244 4267 )
0023 #endif
0024
0025 class item_version_type {
0026 private:
0027 typedef unsigned int base_type;
0028 base_type t;
0029 public:
0030
0031 item_version_type(): t(0) {}
0032 explicit item_version_type(const unsigned int t_) : t(t_){
0033 BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
0034 }
0035 item_version_type(const item_version_type & t_) :
0036 t(t_.t)
0037 {}
0038 item_version_type & operator=(item_version_type rhs){
0039 t = rhs.t;
0040 return *this;
0041 }
0042
0043 operator base_type () const {
0044 return t;
0045 }
0046
0047 operator base_type & () {
0048 return t;
0049 }
0050 bool operator==(const item_version_type & rhs) const {
0051 return t == rhs.t;
0052 }
0053 bool operator<(const item_version_type & rhs) const {
0054 return t < rhs.t;
0055 }
0056 };
0057
0058 #if defined(_MSC_VER)
0059 #pragma warning( pop )
0060 #endif
0061
0062 } }
0063
0064 BOOST_IS_BITWISE_SERIALIZABLE(item_version_type)
0065
0066 BOOST_CLASS_IMPLEMENTATION(item_version_type, primitive_type)
0067
0068 #endif