Update of /cvsroot/boost/boost/boost/interprocess/indexes
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17930/indexes

Modified Files:
        flat_map_index.hpp map_index.hpp null_index.hpp 
        unordered_map_index.hpp 
Log Message:
Changes for official inclusion in the regression tests

Index: flat_map_index.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/indexes/flat_map_index.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- flat_map_index.hpp  7 Aug 2006 14:01:54 -0000       1.2
+++ flat_map_index.hpp  4 May 2007 20:53:09 -0000       1.3
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztañaga 2005-2006. Distributed under the Boost
+// (C) Copyright Ion Gaztañaga 2005-2007. Distributed under 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)
 //
@@ -23,49 +23,53 @@
    as name/shared memory index
 */
 
+//[flat_map_index
 namespace boost { namespace interprocess {
 
-/*!Helper class to define typedefs from IndexTraits*/
+//!Helper class to define typedefs from IndexTraits
 template <class MapConfig>
 struct flat_map_index_aux
 {
    typedef typename MapConfig::key_type            key_type;
    typedef typename MapConfig::mapped_type         mapped_type;
-   typedef typename MapConfig::segment_manager     segment_manager;
+   typedef typename MapConfig::
+      restricted_segment_manager                   restricted_segment_manager;
    typedef std::less<key_type>                     key_less;
    typedef std::pair<key_type, mapped_type>        value_type;
-   typedef allocator<value_type, segment_manager>  allocator_type;
+   typedef allocator<value_type
+                    ,restricted_segment_manager>   allocator_type;
    typedef flat_map<key_type,  mapped_type,
                     key_less, allocator_type>      index_t;
 };
 
-/*!Index type based in flat_map. Just derives from flat_map and
-   defines the interface needed by managed memory segments.*/
+//!Index type based in flat_map. Just derives from flat_map and
+//!defines the interface needed by managed memory segments.
 template <class MapConfig>
 class flat_map_index
    //Derive class from flat_map specialization
    : public flat_map_index_aux<MapConfig>::index_t
 {
-   typedef flat_map_index_aux<MapConfig>        index_aux;
-   typedef typename index_aux::index_t          base_type;
-   typedef typename index_aux::segment_manager  segment_manager;
+   /// @cond
+   typedef flat_map_index_aux<MapConfig>  index_aux;
+   typedef typename index_aux::index_t    base_type;
+   typedef typename index_aux::
+      restricted_segment_manager          restricted_segment_manager;
+   /// @endcond
 
    public:
-   /*!Constructor. Takes a pointer to the
-      segment manager. Can throw*/
-   flat_map_index(segment_manager *segment_mngr)
+   //!Constructor. Takes a pointer to the segment manager. Can throw
+   flat_map_index(restricted_segment_manager *segment_mngr)
       : base_type(typename index_aux::key_less(),
                   typename index_aux::allocator_type(segment_mngr))
    {}
 
-   /*!This reserves memory to optimize the insertion of n
-      elements in the index*/
+   //!This reserves memory to optimize the insertion of n elements in the index
    void reserve(std::size_t n)
    {  base_type::reserve(n);  }
 };
 
 }}   //namespace boost { namespace interprocess
-
+//]
 #include <boost/interprocess/detail/config_end.hpp>
 
 #endif   //#ifndef BOOST_INTERPROCESS_FLAT_MAP_INDEX_HPP

Index: map_index.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/indexes/map_index.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- map_index.hpp       7 Aug 2006 14:01:54 -0000       1.2
+++ map_index.hpp       4 May 2007 20:53:10 -0000       1.3
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztañaga 2005-2006. Distributed under the Boost
+// (C) Copyright Ion Gaztañaga 2005-2007. Distributed under 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)
 //
@@ -17,29 +17,32 @@
 #include <functional>
 #include <utility>
 #include <boost/interprocess/containers/map.hpp>
-#include <boost/interprocess/allocators/private_node_allocator.hpp>
+#include <boost/interprocess/allocators/private_adaptive_pool.hpp>
+//#include <boost/interprocess/allocators/allocator.hpp>
 
 /*!\file
    Describes index adaptor of boost::map container, to use it
    as name/shared memory index
 */
-
 namespace boost { namespace interprocess {
 
 /*!Helper class to define typedefs from IndexTraits*/
 template <class MapConfig>
 struct map_index_aux
 {
-   typedef typename MapConfig::key_type                  key_type;
-   typedef typename MapConfig::mapped_type               mapped_type;
-   typedef std::less<key_type>                           key_less;
-   typedef std::pair<const key_type, mapped_type>        value_type;
-   typedef private_node_allocator
+   typedef typename MapConfig::key_type            key_type;
+   typedef typename MapConfig::mapped_type         mapped_type;
+   typedef std::less<key_type>                     key_less;
+   typedef std::pair<const key_type, mapped_type>  value_type;
+
+   typedef private_adaptive_pool
             <value_type,
-               64,
-               typename MapConfig::segment_manager>     allocator_type;
-   typedef boost::interprocess::map<key_type,  mapped_type,
-                             key_less, allocator_type>   index_t;
+               typename MapConfig::
+         restricted_segment_manager>               allocator_type;
+
+   typedef boost::interprocess::map
+      <key_type,  mapped_type,
+       key_less, allocator_type>                   index_t;
 };
 
 /*!Index type based in boost::interprocess::map. Just derives from 
boost::interprocess::map 
@@ -49,14 +52,17 @@
    //Derive class from map specialization
    : public map_index_aux<MapConfig>::index_t
 {
-   typedef map_index_aux<MapConfig>             index_aux;
-   typedef typename index_aux::index_t          base_type;
-   typedef typename MapConfig::segment_manager  segment_manager;
+   /// @cond
+   typedef map_index_aux<MapConfig>       index_aux;
+   typedef typename index_aux::index_t    base_type;
+   typedef typename MapConfig::
+      restricted_segment_manager          restricted_segment_manager;
+   /// @endcond
 
- public:
+   public:
    /*!Constructor. Takes a pointer to the
       segment manager. Can throw*/
-   map_index(segment_manager *segment_mngr)
+   map_index(restricted_segment_manager *segment_mngr)
       : base_type(typename index_aux::key_less(),
                   segment_mngr){}
 
@@ -66,6 +72,7 @@
       {  /*Does nothing, map has not reserve or rehash*/  }
 };
 
+/// @cond
 /*!Trait class to detect if an index is a node
    index. This allows more efficient operations
    when deallocating named objects.*/
@@ -75,6 +82,7 @@
 {
    enum {   value = true };
 };
+/// @endcond
 
 }}   //namespace boost { namespace interprocess {
 

Index: null_index.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/indexes/null_index.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- null_index.hpp      12 Jun 2006 17:23:17 -0000      1.1
+++ null_index.hpp      4 May 2007 20:53:10 -0000       1.2
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztañaga 2005-2006. Distributed under the Boost
+// (C) Copyright Ion Gaztañaga 2005-2007. Distributed under 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)
 //
@@ -26,13 +26,29 @@
 template <class MapConfig>
 class null_index
 {
-   typedef typename MapConfig::segment_manager segment_manager;
+   /// @cond
+   typedef typename MapConfig::
+      restricted_segment_manager    restricted_segment_manager;
+   /// @endcond
 
- public:
-   
-   /*!Dummy function*/
-   null_index(segment_manager *segment_mngr_hdr){}
+   public:
+   typedef void * iterator;
+   typedef const void * const_iterator;
 
+   const_iterator begin() const
+   {  return const_iterator(0);  }
+
+   iterator begin()
+   {  return iterator(0);  }
+
+   const_iterator end() const
+   {  return const_iterator(0);  }
+
+   iterator end()
+   {  return iterator(0);  }
+
+   /*!Dummy function*/
+   null_index(restricted_segment_manager *segment_mngr_hdr){}
 };
 
 }}   //namespace boost { namespace interprocess {

Index: unordered_map_index.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/interprocess/indexes/unordered_map_index.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- unordered_map_index.hpp     7 Aug 2006 14:01:54 -0000       1.2
+++ unordered_map_index.hpp     4 May 2007 20:53:10 -0000       1.3
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztañaga 2005-2006. Distributed under the Boost
+// (C) Copyright Ion Gaztañaga 2005-2007. Distributed under 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)
 //
@@ -18,7 +18,7 @@
 #include <utility>
 #include <boost/unordered_map.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
-#include <boost/interprocess/allocators/private_node_allocator.hpp>
+#include <boost/interprocess/allocators/private_adaptive_pool.hpp>
 
 /*!\file
    Describes index adaptor of boost::unordered_map container, to use it
@@ -31,14 +31,14 @@
 template <class MapConfig>
 struct unordered_map_index_aux
 {
-   typedef typename MapConfig::key_type                  key_type;
-   typedef typename MapConfig::mapped_type               mapped_type;
-   typedef std::equal_to<key_type>                       key_equal;
-   typedef std::pair<const key_type, mapped_type>        value_type;
-   typedef private_node_allocator
+   typedef typename MapConfig::key_type            key_type;
+   typedef typename MapConfig::mapped_type         mapped_type;
+   typedef std::equal_to<key_type>                 key_equal;
+   typedef std::pair<const key_type, mapped_type>  value_type;
+   typedef private_adaptive_pool
             <value_type,
-               64,
-               typename MapConfig::segment_manager>     allocator_type;
+               typename MapConfig::
+                  restricted_segment_manager>      allocator_type;
     struct hasher
       : std::unary_function<key_type, std::size_t>
     {
@@ -61,14 +61,17 @@
    //Derive class from unordered_map specialization
    : public unordered_map_index_aux<MapConfig>::index_t
 {
+   /// @cond
    typedef unordered_map_index_aux<MapConfig>   index_aux;
    typedef typename index_aux::index_t          base_type;
-   typedef typename MapConfig::segment_manager segment_manager;
+   typedef typename 
+      MapConfig::restricted_segment_manager     restricted_segment_manager;
+   /// @endcond
 
- public:
+   public:
    /*!Constructor. Takes a pointer to the
       segment manager. Can throw*/
-   unordered_map_index(segment_manager *segment_mngr)
+   unordered_map_index(restricted_segment_manager *segment_mngr)
       : base_type(0,
                   typename index_aux::hasher(),
                   typename index_aux::key_equal(),
@@ -80,6 +83,7 @@
       {  base_type::rehash(n);  }
 };
 
+/// @cond
 /*!Trait class to detect if an index is a node
    index. This allows more efficient operations
    when deallocating named objects.*/
@@ -89,6 +93,7 @@
 {
    enum {   value = true };
 };
+/// @endcond
 
 }}   //namespace boost { namespace interprocess {
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to