Chris@16
|
1 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
|
Chris@16
|
4 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 //
|
Chris@16
|
7 // See http://www.boost.org/libs/interprocess for documentation.
|
Chris@16
|
8 //
|
Chris@16
|
9 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
10 #ifndef BOOST_INTERPROCESS_NULL_INDEX_HPP
|
Chris@16
|
11 #define BOOST_INTERPROCESS_NULL_INDEX_HPP
|
Chris@16
|
12
|
Chris@101
|
13 #ifndef BOOST_CONFIG_HPP
|
Chris@101
|
14 # include <boost/config.hpp>
|
Chris@101
|
15 #endif
|
Chris@101
|
16 #
|
Chris@101
|
17 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
18 # pragma once
|
Chris@101
|
19 #endif
|
Chris@101
|
20
|
Chris@16
|
21 #include <boost/interprocess/detail/config_begin.hpp>
|
Chris@16
|
22 #include <boost/interprocess/detail/workaround.hpp>
|
Chris@16
|
23
|
Chris@16
|
24 #include <boost/interprocess/offset_ptr.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 //!\file
|
Chris@16
|
27 //!Describes a null index adaptor, so that if we don't want to construct
|
Chris@16
|
28 //!named objects, we can use this null index type to save resources.
|
Chris@16
|
29
|
Chris@16
|
30 namespace boost {
|
Chris@16
|
31 namespace interprocess {
|
Chris@16
|
32
|
Chris@16
|
33 //!Null index type
|
Chris@16
|
34 //!used to save compilation time when
|
Chris@16
|
35 //!named indexes are not needed.
|
Chris@16
|
36 template <class MapConfig>
|
Chris@16
|
37 class null_index
|
Chris@16
|
38 {
|
Chris@101
|
39 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
|
Chris@16
|
40 typedef typename MapConfig::
|
Chris@16
|
41 segment_manager_base segment_manager_base;
|
Chris@101
|
42 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
|
Chris@16
|
43
|
Chris@16
|
44 public:
|
Chris@101
|
45 typedef int * iterator;
|
Chris@101
|
46 typedef const int * const_iterator;
|
Chris@16
|
47
|
Chris@16
|
48 //!begin() is equal
|
Chris@16
|
49 //!to end()
|
Chris@16
|
50 const_iterator begin() const
|
Chris@16
|
51 { return const_iterator(0); }
|
Chris@16
|
52
|
Chris@16
|
53 //!begin() is equal
|
Chris@16
|
54 //!to end()
|
Chris@16
|
55 iterator begin()
|
Chris@16
|
56 { return iterator(0); }
|
Chris@16
|
57
|
Chris@16
|
58 //!begin() is equal
|
Chris@16
|
59 //!to end()
|
Chris@16
|
60 const_iterator end() const
|
Chris@16
|
61 { return const_iterator(0); }
|
Chris@16
|
62
|
Chris@16
|
63 //!begin() is equal
|
Chris@16
|
64 //!to end()
|
Chris@16
|
65 iterator end()
|
Chris@16
|
66 { return iterator(0); }
|
Chris@16
|
67
|
Chris@16
|
68 //!Empty constructor
|
Chris@16
|
69 null_index(segment_manager_base *){}
|
Chris@16
|
70 };
|
Chris@16
|
71
|
Chris@16
|
72 }} //namespace boost { namespace interprocess {
|
Chris@16
|
73
|
Chris@16
|
74 #include <boost/interprocess/detail/config_end.hpp>
|
Chris@16
|
75
|
Chris@16
|
76 #endif //#ifndef BOOST_INTERPROCESS_NULL_INDEX_HPP
|