tracking.hpp
Go to the documentation of this file.
1 #ifndef BOOST_SERIALIZATION_TRACKING_HPP
2 #define BOOST_SERIALIZATION_TRACKING_HPP
3 
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER)
6 # pragma once
7 #endif
8 
10 // tracking.hpp:
11 
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
16 
17 // See http://www.boost.org for updates, documentation, and revision history.
18 
19 #include <boost/config.hpp>
20 #include <boost/static_assert.hpp>
21 #include <boost/mpl/eval_if.hpp>
22 #include <boost/mpl/identity.hpp>
23 #include <boost/mpl/int.hpp>
24 #include <boost/mpl/equal_to.hpp>
25 #include <boost/mpl/greater.hpp>
27 
33 
34 namespace boost {
35 namespace serialization {
36 
37 struct basic_traits;
38 
39 // default tracking level
40 template<class T>
42  template<class U>
44  typedef typename U::tracking type;
45  };
46  typedef mpl::integral_c_tag tag;
47  // note: at least one compiler complained w/o the full qualification
48  // on basic traits below
49  typedef
50  typename mpl::eval_if<
52  traits_class_tracking< T >,
53  //else
54  typename mpl::eval_if<
56  // pointers are not tracked by default
57  mpl::int_<track_never>,
58  //else
59  typename mpl::eval_if<
60  // for primitives
61  typename mpl::equal_to<
63  mpl::int_<primitive_type>
64  >,
65  // is never
66  mpl::int_<track_never>,
67  // otherwise its selective
68  mpl::int_<track_selectively>
69  > > >::type type;
70  BOOST_STATIC_CONSTANT(int, value = type::value);
71 };
72 
73 template<class T>
74 struct tracking_level :
75  public tracking_level_impl<const T>
76 {
77 };
78 
79 template<class T, enum tracking_type L>
81 {
82  return t.value >= (int)l;
83 }
84 
85 } // namespace serialization
86 } // namespace boost
87 
88 
89 // The STATIC_ASSERT is prevents one from setting tracking for a primitive type.
90 // This almost HAS to be an error. Doing this will effect serialization of all
91 // char's in your program which is almost certainly what you don't want to do.
92 // If you want to track all instances of a given primitive type, You'll have to
93 // wrap it in your own type so its not a primitive anymore. Then it will compile
94 // without problem.
95 #define BOOST_CLASS_TRACKING(T, E) \
96 namespace boost { \
97 namespace serialization { \
98 template<> \
99 struct tracking_level< T > \
100 { \
101  typedef mpl::integral_c_tag tag; \
102  typedef mpl::int_< E> type; \
103  BOOST_STATIC_CONSTANT( \
104  int, \
105  value = tracking_level::type::value \
106  ); \
107  /* tracking for a class */ \
108  BOOST_STATIC_ASSERT(( \
109  mpl::greater< \
110  /* that is a prmitive */ \
111  implementation_level< T >, \
112  mpl::int_<primitive_type> \
113  >::value \
114  )); \
115 }; \
116 }}
117 
118 #endif // BOOST_SERIALIZATION_TRACKING_HPP
boost::serialization::tracking_level_impl::tag
mpl::integral_c_tag tag
Definition: tracking.hpp:46
identity.hpp
config.hpp
boost::serialization::tracking_level_impl
Definition: tracking.hpp:41
boost::serialization::operator>=
bool operator>=(implementation_level< T > t, enum level_type l)
Definition: level.hpp:89
static_assert.hpp
boost::serialization::tracking_level_impl< const T >::type
mpl::eval_if< is_base_and_derived< boost::serialization::basic_traits, const T >, traits_class_tracking< const T >, typename mpl::eval_if< is_pointer< const T >, mpl::int_< track_never >, typename mpl::eval_if< typename mpl::equal_to< implementation_level< const T >, mpl::int_< primitive_type > >, mpl::int_< track_never >, mpl::int_< track_selectively > > > >::type type
Definition: tracking.hpp:69
level.hpp
int.hpp
boost::serialization::tracking_level_impl::traits_class_tracking
Definition: tracking.hpp:43
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
is_pointer.hpp
tracking_enum.hpp
boost::serialization::tracking_level_impl::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(int, value=type::value)
boost::is_base_and_derived
Definition: is_base_and_derived.hpp:231
greater.hpp
eval_if.hpp
integral_c_tag.hpp
boost::mpl::eval_if
Definition: gcc/basic_bind.hpp:408
is_base_and_derived.hpp
boost::serialization::tracking_level
Definition: tracking.hpp:74
boost::serialization::tracking_level_impl::traits_class_tracking::type
U::tracking type
Definition: tracking.hpp:44
equal_to.hpp
type_info_implementation.hpp
boost::mpl::equal_to
Definition: aux_/preprocessed/bcc/equal_to.hpp:67
boost::serialization::tracking_type
tracking_type
Definition: tracking_enum.hpp:27
boost::is_pointer
Definition: is_pointer.hpp:31
boost::serialization::implementation_level
Definition: level.hpp:83


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:48:43