header_holder.hpp
Go to the documentation of this file.
1 /* Copyright 2003-2008 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_HEADER_HOLDER_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP
11 
12 #if defined(_MSC_VER)
13 #pragma once
14 #endif
15 
16 #include <boost/noncopyable.hpp>
17 
18 namespace boost{
19 
20 namespace multi_index{
21 
22 namespace detail{
23 
24 /* A utility class used to hold a pointer to the header node.
25  * The base from member idiom is used because index classes, which are
26  * superclasses of multi_index_container, need this header in construction
27  * time. The allocation is made by the allocator of the multi_index_container
28  * class --hence, this allocator needs also be stored resorting
29  * to the base from member trick.
30  */
31 
32 template<typename NodeTypePtr,typename Final>
33 struct header_holder:private noncopyable
34 {
35  header_holder():member(final().allocate_node()){}
36  ~header_holder(){final().deallocate_node(&*member);}
37 
38  NodeTypePtr member;
39 
40 private:
41  Final& final(){return *static_cast<Final*>(this);}
42 };
43 
44 } /* namespace multi_index::detail */
45 
46 } /* namespace multi_index */
47 
48 } /* namespace boost */
49 
50 #endif
boost::multi_index::member
Definition: member.hpp:122
boost::multi_index::detail::header_holder
Definition: header_holder.hpp:33
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
noncopyable.hpp
boost::multi_index::detail::header_holder::~header_holder
~header_holder()
Definition: header_holder.hpp:36
boost::noncopyable_::noncopyable
Definition: core/noncopyable.hpp:23
boost::multi_index::detail::header_holder::final
Final & final()
Definition: header_holder.hpp:41
boost::multi_index::detail::header_holder::member
NodeTypePtr member
Definition: header_holder.hpp:38
boost::multi_index::detail::header_holder::header_holder
header_holder()
Definition: header_holder.hpp:35


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