]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/archive/detail/oserializer.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / archive / detail / oserializer.hpp
index 612e1f2cb162436aa2d2fe14def7915163c6f70f..17120be7a8e4d7d445ac10e7bf920100cc73a6f9 100644 (file)
@@ -15,7 +15,7 @@
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // oserializer.hpp: interface for serialization system.
 
-// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
 // Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -36,8 +36,8 @@
 #include <boost/mpl/identity.hpp>
 #include <boost/mpl/bool_fwd.hpp>
 
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO   
-    #include <boost/serialization/extended_type_info_typeid.hpp>   
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+    #include <boost/serialization/extended_type_info_typeid.hpp>
 #endif
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/smart_cast.hpp>
@@ -105,23 +105,23 @@ template<class Archive, class T>
 class oserializer : public basic_oserializer
 {
 private:
-    // private constructor to inhibit any existence other than the 
+    // private constructor to inhibit any existence other than the
     // static one
 public:
     explicit BOOST_DLLEXPORT oserializer() :
         basic_oserializer(
             boost::serialization::singleton<
-                typename 
+                typename
                 boost::serialization::type_info_implementation< T >::type
             >::get_const_instance()
         )
     {}
     virtual BOOST_DLLEXPORT void save_object_data(
-        basic_oarchive & ar,    
+        basic_oarchive & ar,
         const void *x
     ) const BOOST_USED;
     virtual bool class_info() const {
-        return boost::serialization::implementation_level< T >::value 
+        return boost::serialization::implementation_level< T >::value
             >= boost::serialization::object_class_info;
     }
     virtual bool tracking(const unsigned int /* flags */) const {
@@ -144,7 +144,7 @@ public:
 
 template<class Archive, class T>
 BOOST_DLLEXPORT void oserializer<Archive, T>::save_object_data(
-    basic_oarchive & ar,    
+    basic_oarchive & ar,
     const void *x
 ) const {
     // make sure call is routed through the highest interface that might
@@ -167,7 +167,7 @@ class pointer_oserializer :
     public basic_pointer_oserializer
 {
 private:
-    const basic_oserializer & 
+    const basic_oserializer &
     get_basic_serializer() const {
         return boost::serialization::singleton<
             oserializer<Archive, T>
@@ -196,11 +196,11 @@ BOOST_DLLEXPORT void pointer_oserializer<Archive, T>::save_object_ptr(
     // be specialized by the user.
     T * t = static_cast<T *>(const_cast<void *>(x));
     const unsigned int file_version = boost::serialization::version< T >::value;
-    Archive & ar_impl 
+    Archive & ar_impl
         = boost::serialization::smart_cast_reference<Archive &>(ar);
     boost::serialization::save_construct_data_adl<Archive, T>(
-        ar_impl, 
-        t, 
+        ar_impl,
+        t,
         file_version
     );
     ar_impl << boost::serialization::make_nvp(NULL, * t);
@@ -210,14 +210,14 @@ template<class Archive, class T>
 pointer_oserializer<Archive, T>::pointer_oserializer() :
     basic_pointer_oserializer(
         boost::serialization::singleton<
-            typename 
+            typename
             boost::serialization::type_info_implementation< T >::type
         >::get_const_instance()
     )
 {
     // make sure appropriate member function is instantiated
     boost::serialization::singleton<
-        oserializer<Archive, T> 
+        oserializer<Archive, T>
     >::get_mutable_instance().set_bpos(this);
     archive_serializer_map<Archive>::insert(this);
 }
@@ -244,8 +244,8 @@ struct save_non_pointer_type {
             // make sure call is routed through the highest interface that might
             // be specialized by the user.
             boost::serialization::serialize_adl(
-                ar, 
-                const_cast<T &>(t), 
+                ar,
+                const_cast<T &>(t),
                 ::boost::serialization::version< T >::value
             );
         }
@@ -281,7 +281,7 @@ struct save_non_pointer_type {
 
     template<class T>
     static void invoke(Archive & ar, const T & t){
-        typedef 
+        typedef
             typename mpl::eval_if<
             // if its primitive
                 mpl::equal_to<
@@ -310,7 +310,7 @@ struct save_non_pointer_type {
             // else
                 // do a fast save only tracking is turned off
                 mpl::identity<save_conditional>
-            > > >::type typex; 
+            > > >::type typex;
         check_object_versioning< T >();
         typex::invoke(ar, t);
     }
@@ -344,15 +344,15 @@ struct save_pointer_type {
 
     template<class T>
     static const basic_pointer_oserializer * register_type(Archive &ar, T* const /*t*/){
-        // there should never be any need to save an abstract polymorphic 
+        // there should never be any need to save an abstract polymorphic
         // class pointer.  Inhibiting code generation for this
         // permits abstract base classes to be used - note: exception
         // virtual serialize functions used for plug-ins
-        typedef 
+        typedef
             typename mpl::eval_if<
                 boost::serialization::is_abstract< T >,
                 mpl::identity<abstract>,
-                mpl::identity<non_abstract>       
+                mpl::identity<non_abstract>
             >::type typex;
         return typex::template register_type< T >(ar);
     }
@@ -361,10 +361,10 @@ struct save_pointer_type {
     {
         template<class T>
         static void save(
-            Archive &ar, 
+            Archive &ar,
             T & t
         ){
-            const basic_pointer_oserializer & bpos = 
+            const basic_pointer_oserializer & bpos =
                 boost::serialization::singleton<
                     pointer_oserializer<Archive, T>
                 >::get_const_instance();
@@ -377,13 +377,13 @@ struct save_pointer_type {
     {
         template<class T>
         static void save(
-            Archive &ar, 
+            Archive &ar,
             T & t
         ){
-            typename 
+            typename
             boost::serialization::type_info_implementation< T >::type const
             & i = boost::serialization::singleton<
-                typename 
+                typename
                 boost::serialization::type_info_implementation< T >::type
             >::get_const_instance();
 
@@ -417,8 +417,8 @@ struct save_pointer_type {
             // convert pointer to more derived type. if this is thrown
             // it means that the base/derived relationship hasn't be registered
             vp = serialization::void_downcast(
-                *true_type, 
-                *this_type, 
+                *true_type,
+                *this_type,
                 static_cast<const void *>(&t)
             );
             if(NULL == vp){
@@ -431,7 +431,7 @@ struct save_pointer_type {
                 );
             }
 
-            // since true_type is valid, and this only gets made if the 
+            // since true_type is valid, and this only gets made if the
             // pointer oserializer object has been created, this should never
             // fail
             const basic_pointer_oserializer * bpos
@@ -454,7 +454,7 @@ struct save_pointer_type {
 
     template<class T>
     static void save(
-        Archive & ar, 
+        Archive & ar,
         const T & t
     ){
         check_pointer_level< T >();
@@ -471,7 +471,7 @@ struct save_pointer_type {
     static void invoke(Archive &ar, const TPtr t){
         register_type(ar, t);
         if(NULL == t){
-            basic_oarchive & boa 
+            basic_oarchive & boa
                 = boost::serialization::smart_cast_reference<basic_oarchive &>(ar);
             boa.save_null_pointer();
             save_access::end_preamble(ar);
@@ -498,11 +498,11 @@ struct save_array_type
     template<class T>
     static void invoke(Archive &ar, const T &t){
         typedef typename boost::remove_extent< T >::type value_type;
-        
+
         save_access::end_preamble(ar);
         // consider alignment
         std::size_t c = sizeof(t) / (
-            static_cast<const char *>(static_cast<const void *>(&t[1])) 
+            static_cast<const char *>(static_cast<const void *>(&t[1]))
             - static_cast<const char *>(static_cast<const void *>(&t[0]))
         );
         boost::serialization::collection_size_type count(c);
@@ -522,7 +522,7 @@ struct save_array_type
 
 template<class Archive, class T>
 inline void save(Archive & ar, /*const*/ T &t){
-    typedef 
+    typedef
         typename mpl::eval_if<is_pointer< T >,
             mpl::identity<detail::save_pointer_type<Archive> >,
         //else