archive_constructed.hpp
Go to the documentation of this file.
1 /* Copyright 2003-2015 Joaquin M Lopez Munoz.
2  * Distributed under the Boost Software License, Version 1.0.
3  * (See accompanying file LICENSE_1_0.txt or copy at
4  * http://www.boost.org/LICENSE_1_0.txt)
5  *
6  * See http://www.boost.org/libs/multi_index for library home page.
7  */
8 
9 #ifndef BOOST_MULTI_INDEX_DETAIL_ARCHIVE_CONSTRUCTED_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_ARCHIVE_CONSTRUCTED_HPP
11 
12 #if defined(_MSC_VER)
13 #pragma once
14 #endif
15 
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
18 #include <boost/noncopyable.hpp>
22 
23 namespace boost{
24 
25 namespace multi_index{
26 
27 namespace detail{
28 
29 /* constructs a stack-based object from a serialization archive */
30 
31 template<typename T>
33 {
34  template<class Archive>
35  archive_constructed(Archive& ar,const unsigned int version)
36  {
38  BOOST_TRY{
39  ar>>get();
40  }
41  BOOST_CATCH(...){
42  (&get())->~T();
44  }
46  }
47 
48  template<class Archive>
49  archive_constructed(const char* name,Archive& ar,const unsigned int version)
50  {
52  BOOST_TRY{
53  ar>>serialization::make_nvp(name,get());
54  }
55  BOOST_CATCH(...){
56  (&get())->~T();
58  }
60  }
61 
63  {
64  (&get())->~T();
65  }
66 
67  T& get(){return *reinterpret_cast<T*>(&space);}
68 
69 private:
71 };
72 
73 } /* namespace multi_index::detail */
74 
75 } /* namespace multi_index */
76 
77 } /* namespace boost */
78 
79 #endif
boost::serialization::load_construct_data_adl
void load_construct_data_adl(Archive &ar, T *t, const unsigned int file_version)
Definition: serialization.hpp:141
no_exceptions_support.hpp
T
T
Definition: mem_fn_cc.hpp:25
config.hpp
boost::type
Definition: type.hpp:14
alignment_of.hpp
boost::aligned_storage
Definition: type_traits/aligned_storage.hpp:75
aligned_storage.hpp
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
serialization.hpp
noncopyable.hpp
boost::multi_index::detail::archive_constructed::space
aligned_storage< sizeof(T), alignment_of< T >::value >::type space
Definition: archive_constructed.hpp:70
boost::multi_index::detail::archive_constructed::get
T & get()
Definition: archive_constructed.hpp:67
boost::noncopyable_::noncopyable
Definition: core/noncopyable.hpp:23
BOOST_TRY
#define BOOST_TRY
Definition: core/no_exceptions_support.hpp:27
boost::multi_index::detail::archive_constructed::archive_constructed
archive_constructed(const char *name, Archive &ar, const unsigned int version)
Definition: archive_constructed.hpp:49
BOOST_CATCH
#define BOOST_CATCH(x)
Definition: core/no_exceptions_support.hpp:28
boost::multi_index::detail::archive_constructed::archive_constructed
archive_constructed(Archive &ar, const unsigned int version)
Definition: archive_constructed.hpp:35
boost::alignment_of
Definition: alignment_of.hpp:28
boost::multi_index::detail::archive_constructed::~archive_constructed
~archive_constructed()
Definition: archive_constructed.hpp:62
boost::serialization::make_nvp
const nvp< T > make_nvp(const char *name, T &t)
Definition: nvp.hpp:79
BOOST_RETHROW
#define BOOST_RETHROW
Definition: core/no_exceptions_support.hpp:29
BOOST_CATCH_END
#define BOOST_CATCH_END
Definition: core/no_exceptions_support.hpp:30
boost::multi_index::detail::archive_constructed
Definition: archive_constructed.hpp:32


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