Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/interprocess for documentation. Chris@16: // Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: #ifndef BOOST_INTERPROCESS_NULL_INDEX_HPP Chris@16: #define BOOST_INTERPROCESS_NULL_INDEX_HPP Chris@16: Chris@101: #ifndef BOOST_CONFIG_HPP Chris@101: # include Chris@101: #endif Chris@101: # Chris@101: #if defined(BOOST_HAS_PRAGMA_ONCE) Chris@101: # pragma once Chris@101: #endif Chris@101: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: //!\file Chris@16: //!Describes a null index adaptor, so that if we don't want to construct Chris@16: //!named objects, we can use this null index type to save resources. Chris@16: Chris@16: namespace boost { Chris@16: namespace interprocess { Chris@16: Chris@16: //!Null index type Chris@16: //!used to save compilation time when Chris@16: //!named indexes are not needed. Chris@16: template Chris@16: class null_index Chris@16: { Chris@101: #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) Chris@16: typedef typename MapConfig:: Chris@16: segment_manager_base segment_manager_base; Chris@101: #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED Chris@16: Chris@16: public: Chris@101: typedef int * iterator; Chris@101: typedef const int * const_iterator; Chris@16: Chris@16: //!begin() is equal Chris@16: //!to end() Chris@16: const_iterator begin() const Chris@16: { return const_iterator(0); } Chris@16: Chris@16: //!begin() is equal Chris@16: //!to end() Chris@16: iterator begin() Chris@16: { return iterator(0); } Chris@16: Chris@16: //!begin() is equal Chris@16: //!to end() Chris@16: const_iterator end() const Chris@16: { return const_iterator(0); } Chris@16: Chris@16: //!begin() is equal Chris@16: //!to end() Chris@16: iterator end() Chris@16: { return iterator(0); } Chris@16: Chris@16: //!Empty constructor Chris@16: null_index(segment_manager_base *){} Chris@16: }; Chris@16: Chris@16: }} //namespace boost { namespace interprocess { Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //#ifndef BOOST_INTERPROCESS_NULL_INDEX_HPP