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

Modified Files:
        in_place_interface.hpp iterators.hpp managed_memory_impl.hpp 
        managed_open_or_create_impl.hpp 
Added Files:
        math_functions.hpp 
Log Message:
New Interprocess version

--- NEW FILE: math_functions.hpp ---
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Stephen Cleary 2000.
// (C) Copyright Ion Gaztanaga 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)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
// This file is a slightly modified file from Boost.Pool
//
//////////////////////////////////////////////////////////////////////////////

#ifndef BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP
#define BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP

namespace boost {
namespace interprocess {
namespace detail {

// Greatest common divisor and least common multiple

//
// gcd is an algorithm that calculates the greatest common divisor of two
//  integers, using Euclid's algorithm.
//
// Pre: A > 0 && B > 0
// Recommended: A > B
template <typename Integer>
inline Integer gcd(Integer A, Integer B)
{
   do
   {
      const Integer tmp(B);
      B = A % B;
      A = tmp;
   } while (B != 0);

   return A;
}

//
// lcm is an algorithm that calculates the least common multiple of two
//  integers.
//
// Pre: A > 0 && B > 0
// Recommended: A > B
template <typename Integer>
inline Integer lcm(const Integer & A, const Integer & B)
{
   Integer ret = A;
   ret /= gcd(A, B);
   ret *= B;
   return ret;
}

template <typename Integer>
inline Integer log2_ceil(const Integer & A)
{
   Integer i = 0;
   Integer power_of_2 = 1;

   while(power_of_2 < A){
      power_of_2 <<= 1;
      ++i;
   }
   return i;
}

template <typename Integer>
inline Integer upper_power_of_2(const Integer & A)
{
   Integer power_of_2 = 1;

   while(power_of_2 < A){
      power_of_2 <<= 1;
   }
   return power_of_2;
}

} // namespace detail
} // namespace interprocess
} // namespace boost

#endif

Index: in_place_interface.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/interprocess/detail/in_place_interface.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- in_place_interface.hpp      23 Jun 2007 12:52:18 -0000      1.2
+++ in_place_interface.hpp      22 Jul 2007 14:04:15 -0000      1.3
@@ -38,9 +38,7 @@
    std::size_t size;
    const char *type_name;
 
-   virtual void construct(void *mem) = 0;
    virtual void construct_n(void *mem, std::size_t num, std::size_t 
&constructed) = 0;
-   virtual void destroy(void *mem) = 0;
    virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) 
= 0;
    virtual ~in_place_interface(){}
 };
@@ -52,9 +50,6 @@
       :  in_place_interface(detail::alignment_of<T>::value, sizeof(T), 
typeid(T).name())
    {}
 
-   virtual void destroy(void *mem)
-   {  static_cast<T*>(mem)->~T();   }
-
    virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed)
    {
       T* memory = static_cast<T*>(mem);
@@ -62,8 +57,11 @@
          (memory++)->~T();
    }
 
-   virtual void construct(void *) {}
    virtual void construct_n(void *, std::size_t, std::size_t &) {}
+
+   private:
+   void destroy(void *mem)
+   {  static_cast<T*>(mem)->~T();   }
 };
 
 }

Index: iterators.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/detail/iterators.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- iterators.hpp       23 Jun 2007 12:52:18 -0000      1.2
+++ iterators.hpp       22 Jul 2007 14:04:15 -0000      1.3
@@ -24,6 +24,7 @@
 #include <boost/interprocess/interprocess_fwd.hpp>
 
 #include <iterator>
+#include <boost/interprocess/detail/type_traits.hpp>
 
 namespace boost {
 namespace interprocess { 
@@ -127,6 +128,106 @@
 };
 
 template <class T, class Difference = std::ptrdiff_t>
+class default_construct_iterator
+  : public std::iterator
+      <std::random_access_iterator_tag, T, Difference, const T*, const T &>
+{
+   typedef  default_construct_iterator<T, Difference> this_type;
+
+   public:
+   explicit default_construct_iterator(Difference range_size)
+      :  m_num(range_size){}
+
+   //Constructors
+   default_construct_iterator()
+      :  m_num(0){}
+
+   default_construct_iterator& operator++() 
+   { increment();   return *this;   }
+   
+   default_construct_iterator operator++(int)
+   {
+      default_construct_iterator result (*this);
+      increment();
+      return result;
+   }
+
+   friend bool operator== (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return i.equal(i2); }
+
+   friend bool operator!= (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return !(i == i2); }
+
+   friend bool operator< (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return i.less(i2); }
+
+   friend bool operator> (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return i2 < i; }
+
+   friend bool operator<= (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return !(i > i2); }
+
+   friend bool operator>= (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return !(i < i2); }
+
+   friend Difference operator- (const default_construct_iterator& i, const 
default_construct_iterator& i2)
+   { return i2.distance_to(i); }
+
+   //Arithmetic
+   default_construct_iterator& operator+=(Difference off)
+   {  this->advance(off); return *this;   }
+
+   default_construct_iterator operator+(Difference off) const
+   {
+      default_construct_iterator other(*this);
+      other.advance(off);
+      return other;
+   }
+
+   friend default_construct_iterator operator+(Difference off, const 
default_construct_iterator& right)
+   {  return right + off; }
+
+   default_construct_iterator& operator-=(Difference off)
+   {  this->advance(-off); return *this;   }
+
+   default_construct_iterator operator-(Difference off) const
+   {  return *this + (-off);  }
+
+   const T& operator*() const
+   { return dereference(); }
+
+   const T* operator->() const
+   { return &(dereference()); }
+
+   private:
+   Difference  m_num;
+
+   void increment()
+   { --m_num; }
+
+   void decrement()
+   { ++m_num; }
+
+   bool equal(const this_type &other) const
+   {  return m_num == other.m_num;   }
+
+   bool less(const this_type &other) const
+   {  return other.m_num < m_num;   }
+
+   const T & dereference() const
+   { 
+      static T dummy;
+      return dummy;
+   }
+
+   void advance(Difference n)
+   {  m_num -= n; }
+
+   Difference distance_to(const this_type &other)const
+   {  return m_num - other.m_num;   }
+};
+
+template <class T, class Difference = std::ptrdiff_t>
 class repeat_iterator
   : public std::iterator
       <std::random_access_iterator_tag, T, Difference>
@@ -237,22 +338,39 @@
    mutable PseudoReference m_value;
 };
 
+template <class T>
+struct operator_arrow_proxy<T&>
+{
+   operator_arrow_proxy(T &px)
+      :  m_value(px)
+   {}
+
+   T* operator->() const { return &m_value; }
+   // This function is needed for MWCW and BCC, which won't call operator->
+   // again automatically per 13.3.1.2 para 8
+//   operator T*() const { return &m_value; }
+   mutable T &m_value;
+};
 
 template <class Iterator, class UnaryFunction>
 class transform_iterator
    : public UnaryFunction
    , public std::iterator
       < typename Iterator::iterator_category
-      , typename Iterator::value_type
+      , typename detail::remove_reference<typename 
UnaryFunction::result_type>::type
       , typename Iterator::difference_type
-      , typename Iterator::pointer
+      , operator_arrow_proxy<typename UnaryFunction::result_type>
       , typename UnaryFunction::result_type>
 {
    public:
-   explicit transform_iterator(const Iterator &it, const UnaryFunction &f)
+   explicit transform_iterator(const Iterator &it, const UnaryFunction &f = 
UnaryFunction())
       :  UnaryFunction(f), m_it(it)
    {}
 
+   explicit transform_iterator()
+      :  UnaryFunction(), m_it()
+   {}
+
    //Constructors
    transform_iterator& operator++() 
    { increment();   return *this;   }

Index: managed_memory_impl.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/interprocess/detail/managed_memory_impl.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- managed_memory_impl.hpp     23 Jun 2007 12:52:18 -0000      1.7
+++ managed_memory_impl.hpp     22 Jul 2007 14:04:16 -0000      1.8
@@ -19,11 +19,10 @@
 #include <boost/interprocess/detail/workaround.hpp>
 
 #include <boost/interprocess/interprocess_fwd.hpp>
-#include <boost/interprocess/mem_algo/simple_seq_fit.hpp>
 #include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
 #include <boost/interprocess/sync/mutex_family.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
-#include <boost/interprocess/detail/creation_tags.hpp>
+#include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/sync/interprocess_mutex.hpp>
 #include <boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/offset_ptr.hpp>
@@ -37,14 +36,12 @@
 #include <new>
 #include <assert.h>
 
-/*!\file
-   Describes a named shared memory allocation user class. 
-*/
+//!\file
+//!Describes a named shared memory allocation user class. 
+//!
 
 namespace boost {
-
 namespace interprocess {
-
 namespace detail {
 
 template<class BasicManagedMemoryImpl>
@@ -94,7 +91,15 @@
    typedef typename segment_manager::
       unique_index_t::const_iterator                  const_unique_iterator;
 
-   enum {   PayloadPerAllocation = segment_manager::PayloadPerAllocation   };
+   /// @cond
+
+   //Experimental. Don't use.
+
+   typedef typename segment_manager::multiallocation_iterator    
multiallocation_iterator;
+
+   /// @endcond
+
+   static const std::size_t PayloadPerAllocation = 
segment_manager::PayloadPerAllocation;
 
    private:
    typedef basic_managed_memory_impl
@@ -271,12 +276,44 @@
    void * allocate_aligned (std::size_t nbytes, std::size_t alignment, 
std::nothrow_t nothrow)
    {   return mp_header->allocate_aligned(nbytes, alignment, nothrow);  }
 
+   template<class T>
+   std::pair<T *, bool>
+      allocation_command  (allocation_type command,   std::size_t limit_size,
+                           std::size_t preferred_size,std::size_t 
&received_size,
+                           T *reuse_ptr = 0)
+   {  
+      return mp_header->allocation_command
+         (command, limit_size, preferred_size, received_size, reuse_ptr);
+   }
+
    //!Allocates nbytes bytes aligned to "alignment" bytes. "alignment"
    //!must be power of two. If no 
    //!memory is available throws a boost::interprocess::bad_alloc exception
    void * allocate_aligned(std::size_t nbytes, std::size_t alignment)
    {   return mp_header->allocate_aligned(nbytes, alignment);  }
 
+   /// @cond
+
+   //Experimental. Don't use.
+
+   //!Allocates n_elements of elem_size bytes.
+   multiallocation_iterator allocate_many(std::size_t elem_size, std::size_t 
min_elements, std::size_t preferred_elements, std::size_t &received_elements)
+   {  return mp_header->allocate_many(elem_size, min_elements, 
preferred_elements, received_elements); }
+
+   //!Allocates n_elements, each one of elem_sizes[i] bytes.
+   multiallocation_iterator allocate_many(const std::size_t *elem_sizes, 
std::size_t n_elements)
+   {  return mp_header->allocate_many(elem_sizes, n_elements); }
+
+   //!Allocates n_elements of elem_size bytes.
+   multiallocation_iterator allocate_many(std::size_t elem_size, std::size_t 
min_elements, std::size_t preferred_elements, std::size_t &received_elements, 
std::nothrow_t nothrow)
+   {  return mp_header->allocate_many(elem_size, min_elements, 
preferred_elements, received_elements, nothrow); }
+
+   //!Allocates n_elements, each one of elem_sizes[i] bytes.
+   multiallocation_iterator allocate_many(const std::size_t *elem_sizes, 
std::size_t n_elements, std::nothrow_t nothrow)
+   {  return mp_header->allocate_many(elem_sizes, n_elements, nothrow); }
+
+   /// @endcond
+
    //!Marks previously allocated memory as free. Never throws.
    void  deallocate           (void *addr)
    {   if (mp_header) mp_header->deallocate(addr);  }
@@ -286,7 +323,7 @@
    //!Never throws.
    template <class T>
    std::pair<T*, std::size_t> find  (char_ptr_holder_t name)
-   {   return mp_header->find<T>(name); }
+   {   return mp_header->template find<T>(name); }
 
    //!Creates a named object or array in memory
    //!
@@ -307,7 +344,7 @@
    template <class T>
    typename segment_manager::template construct_proxy<T>::type
       construct(char_ptr_holder_t name)
-   {   return mp_header->construct<T>(name);  }
+   {   return mp_header->template construct<T>(name);  }
 
    //!Finds or creates a named object or array in memory
    //!
@@ -328,7 +365,7 @@
    template <class T>
    typename segment_manager::template construct_proxy<T>::type
       find_or_construct(char_ptr_holder_t name)
-   {   return mp_header->find_or_construct<T>(name);  }
+   {   return mp_header->template find_or_construct<T>(name);  }
 
    //!Creates a named object or array in memory
    //!
@@ -349,7 +386,7 @@
    template <class T>
    typename segment_manager::template construct_proxy<T>::type
       construct(char_ptr_holder_t name, std::nothrow_t nothrow)
-   {   return mp_header->construct<T>(name, nothrow);  }
+   {   return mp_header->template construct<T>(name, nothrow);  }
 
    //!Finds or creates a named object or array in memory
    //!
@@ -370,7 +407,7 @@
    template <class T>
    typename segment_manager::template construct_proxy<T>::type
       find_or_construct(char_ptr_holder_t name, std::nothrow_t nothrow)
-   {   return mp_header->find_or_construct<T>(name, nothrow);  }
+   {   return mp_header->template find_or_construct<T>(name, nothrow);  }
 
    //!Creates a named array from iterators in memory 
    //!
@@ -391,7 +428,7 @@
    template <class T>
    typename segment_manager::template construct_iter_proxy<T>::type
       construct_it(char_ptr_holder_t name)
-   {   return mp_header->construct_it<T>(name);  }
+   {   return mp_header->template construct_it<T>(name);  }
 
    //!Finds or creates a named array from iterators in memory 
    //!
@@ -414,10 +451,10 @@
    template <class T>
    typename segment_manager::template construct_iter_proxy<T>::type
       find_or_construct_it(char_ptr_holder_t name)
-   {   return mp_header->find_or_construct_it<T>(name);  }
-
-   /*!Creates a named array from iterators in memory 
+   {   return mp_header->template find_or_construct_it<T>(name);  }
 
+   //!Creates a named array from iterators in memory 
+   //!
    //!Allocates and constructs an array of T in memory, 
    //!associates this with the given name and returns a pointer to the 
    //!created object. Each element in the array is created using the
@@ -435,9 +472,9 @@
    template <class T>
    typename segment_manager::template construct_iter_proxy<T>::type
       construct_it(char_ptr_holder_t name, std::nothrow_t nothrow)
-   {   return mp_header->construct_it<T>(name, nothrow);  }
+   {   return mp_header->template construct_it<T>(name, nothrow);  }
 
-   /*!Finds or creates a named array from iterators in memory 
+   //!Finds or creates a named array from iterators in memory 
    //!
    //!Tries to find an object with the given name in memory. If 
    //!found, returns the pointer to this pointer. If the object is not found, 
@@ -458,7 +495,7 @@
    template <class T>
    typename segment_manager::template construct_iter_proxy<T>::type
       find_or_construct_it(char_ptr_holder_t name, std::nothrow_t nothrow)
-   {   return mp_header->find_or_construct_it<T>(name, nothrow);  }
+   {   return mp_header->template find_or_construct_it<T>(name, nothrow);  }
 
    //!Calls a functor and guarantees that no new construction, search or
    //!destruction will be executed by any process while executing the object
@@ -493,13 +530,13 @@
    //!destructors are called. If any of these throws, the exceptions are
    //!ignored. The name association will be erased, memory will be freed and
    //!the first exception will be thrown. This guarantees the unlocking of
-   //! mutexes and other resources.
+   //!mutexes and other resources.
    //!
    //!For all theses reasons, classes with throwing destructors are not 
    //!recommended.
    template <class T>
    bool destroy(const CharType *name)
-   {   return mp_header->destroy<T>(name); }
+   {   return mp_header->template destroy<T>(name); }
 
    //!Destroys the unique instance of type T
    //!
@@ -519,7 +556,7 @@
    //!recommended for  memory.
    template <class T>
    bool destroy(const detail::unique_instance_t *const )
-   {   return mp_header->destroy<T>(unique_instance);  }
+   {   return mp_header->template destroy<T>(unique_instance);  }
 
    //!Destroys the object (named, unique, or anonymous)
    //!
@@ -538,20 +575,26 @@
    //!For all theses reasons, classes with throwing destructors are not 
    //!recommended for  memory.
    template <class T>
-   bool destroy_ptr(const T *ptr)
-   {  return mp_header->destroy_ptr<T>(ptr); }
+   void destroy_ptr(const T *ptr)
+   {  mp_header->template destroy_ptr<T>(ptr); }
 
    //!Returns the name of an object created with construct/find_or_construct
    //!functions. Does not throw
    template<class T>
-   const char *get_name(const T *ptr)
-   {  return mp_header->get_name(ptr);   }
+   static const char_type *get_instance_name(const T *ptr)
+   {  return segment_manager::get_instance_name(ptr);   }
 
-   //!Returns is the the name of an object created with 
construct/find_or_construct
-   //!functions. Does not throw
+   //!Returns is the type an object created with construct/find_or_construct
+   //!functions. Does not throw.
    template<class T>
-   detail::instance_type get_type(const T *ptr)
-   {  return mp_header->get_type(ptr); }
+   static instance_type get_instance_type(const T *ptr)
+   {  return segment_manager::get_instance_type(ptr); }
+
+   //!Returns the length of an object created with construct/find_or_construct
+   //!functions (1 if is a single element, >=1 if it's an array). Does not 
throw.
+   template<class T>
+   static std::size_t get_instance_length(const T *ptr)
+   {  return segment_manager::get_instance_length(ptr); }
 
    //!Preallocates needed index resources to optimize the 
    //!creation of "num" named objects in the  memory segment.
@@ -565,15 +608,24 @@
    void reserve_unique_objects(std::size_t num)
    {  mp_header->reserve_unique_objects(num);  }
 
-   //!Returns the number of named objects stored in the segment.
+   //!Calls shrink_to_fit in both named and unique object indexes
+   //to try to free unused memory from those indexes.
+   void shrink_to_fit_indexes()
+   {  mp_header->shrink_to_fit_indexes();  }
+
+   //!Returns the number of named objects stored
+   //!in the managed segment.
    std::size_t get_num_named_objects()
    {  return mp_header->get_num_named_objects();  }
 
-   //!Returns the number of unique objects stored in the segment.
+   //!Returns the number of unique objects stored
+   //!in the managed segment.
    std::size_t get_num_unique_objects()
    {  return mp_header->get_num_unique_objects();  }
 
-   //!Saves  memory to a file. Never throws.
+   //!Saves the managed segment memory to a file.
+   //!It's NOT thread-safe. Returns true if successful.
+   //!Never throws.
    template<class CharT> 
    bool save_to_file (const CharT *filename)
    {
@@ -584,22 +636,32 @@
       return file.is_open() && save_to_ostream (file);
    }
 
-   //!Saves memory to a std::ostream. Never throws.
+   //!Saves the managed segment memory to a std::ostream.
+   //!It's NOT thread-safe. Returns true if successful.
+   //!Never throws.
    bool save_to_ostream (std::ostream &outstream)
    {
       return outstream.write(char_ptr_cast(mp_header), 
                              (std::streamsize)get_size()).good();
    }
 
+   //!Returns a constant iterator to the index storing the
+   //!named allocations. NOT thread-safe. Never throws.
    const_named_iterator named_begin() const
    {  return mp_header->named_begin(); }
 
+   //!Returns a constant iterator to the end of the index 
+   //!storing the named allocations. NOT thread-safe. Never throws.
    const_named_iterator named_end() const
    {  return mp_header->named_end(); }
 
+   //!Returns a constant iterator to the index storing the
+   //!unique allocations. NOT thread-safe. Never throws.
    const_unique_iterator unique_begin() const
    {  return mp_header->unique_begin(); }
 
+   //!Returns a constant iterator to the end of the index 
+   //!storing the unique allocations. NOT thread-safe. Never throws.
    const_unique_iterator unique_end() const
    {  return mp_header->unique_end(); }
 
@@ -612,7 +674,9 @@
       assert(addr); 
       mp_header = static_cast<segment_manager*>(addr);  
    }
-   
+
+   //!Swaps the segment manager's managed by this managed memory segment.
+   //!NOT thread-safe. Never throws.
    void swap(basic_managed_memory_impl &other)
    {  std::swap(mp_header, other.mp_header); }
 
@@ -624,13 +688,13 @@
 class create_open_func
 {
    public:
-   create_open_func(BasicManagedMemoryImpl * const frontend, create_enum_t 
type)
+   create_open_func(BasicManagedMemoryImpl * const frontend, 
detail::create_enum_t type)
       : m_frontend(frontend), m_type(type){}
 
    bool operator()(void *addr, std::size_t size, bool created) const
    {  
-      if(((m_type == DoOpen)   &&  created) || 
-         ((m_type == DoCreate) && !created))
+      if(((m_type == detail::DoOpen)   &&  created) || 
+         ((m_type == detail::DoCreate) && !created))
          return false;
 
       if(created)
@@ -641,7 +705,7 @@
 
    private:
    BasicManagedMemoryImpl *m_frontend;
-   create_enum_t           m_type;
+   detail::create_enum_t           m_type;
 };
 
 }  //namespace detail {

Index: managed_open_or_create_impl.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/interprocess/detail/managed_open_or_create_impl.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- managed_open_or_create_impl.hpp     23 Jun 2007 12:52:18 -0000      1.8
+++ managed_open_or_create_impl.hpp     22 Jul 2007 14:04:16 -0000      1.9
@@ -13,12 +13,12 @@
 
 #include <boost/interprocess/detail/os_thread_functions.hpp>
 #include <boost/interprocess/detail/os_file_functions.hpp>
-#include <boost/interprocess/detail/creation_tags.hpp>
+#include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/mapped_region.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
 #include <boost/interprocess/detail/type_traits.hpp>
 #include <boost/interprocess/detail/atomic.hpp>
-#include <boost/interprocess/detail/creation_tags.hpp>
+#include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
 #include <boost/cstdint.hpp>
 
@@ -52,7 +52,7 @@
             , detail::alignment_of<detail::max_align>::value>::value
    };
 
-   managed_open_or_create_impl(detail::create_only_t, 
+   managed_open_or_create_impl(create_only_t, 
                  const char *name,
                  std::size_t size,
                  mode_t mode = read_write,
@@ -60,21 +60,21 @@
    {
       m_name = name;
       priv_open_or_create
-         ( DoCreate
+         ( detail::DoCreate
          , size
          , mode
          , addr
          , null_mapped_region_function());
    }
 
-   managed_open_or_create_impl(detail::open_only_t, 
+   managed_open_or_create_impl(open_only_t, 
                  const char *name,
                  mode_t mode = read_write,
                  const void *addr = 0)
    {
       m_name = name;
       priv_open_or_create
-         ( DoOpen
+         ( detail::DoOpen
          , 0
          , mode
          , addr
@@ -82,7 +82,7 @@
    }
 
 
-   managed_open_or_create_impl(detail::open_or_create_t, 
+   managed_open_or_create_impl(open_or_create_t, 
                  const char *name,
                  std::size_t size,
                  mode_t mode = read_write,
@@ -90,7 +90,7 @@
    {
       m_name = name;
       priv_open_or_create
-         ( DoCreateOrOpen
+         ( detail::DoCreateOrOpen
          , size
          , mode
          , addr
@@ -98,7 +98,7 @@
    }
 
    template <class ConstructFunc>
-   managed_open_or_create_impl(detail::create_only_t, 
+   managed_open_or_create_impl(create_only_t, 
                  const char *name,
                  std::size_t size,
                  mode_t mode,
@@ -107,7 +107,7 @@
    {
       m_name = name;
       priv_open_or_create
-         (DoCreate
+         (detail::DoCreate
          , size
          , mode
          , addr
@@ -115,7 +115,7 @@
    }
 
    template <class ConstructFunc>
-   managed_open_or_create_impl(detail::open_only_t, 
+   managed_open_or_create_impl(open_only_t, 
                  const char *name,
                  mode_t mode,
                  const void *addr,
@@ -123,7 +123,7 @@
    {
       m_name = name;
       priv_open_or_create
-         ( DoOpen
+         ( detail::DoOpen
          , 0
          , mode
          , addr
@@ -131,7 +131,7 @@
    }
 
    template <class ConstructFunc>
-   managed_open_or_create_impl(detail::open_or_create_t, 
+   managed_open_or_create_impl(open_or_create_t, 
                  const char *name,
                  std::size_t size,
                  mode_t mode,
@@ -140,7 +140,7 @@
    {
       m_name = name;
       priv_open_or_create
-         ( DoCreateOrOpen
+         ( detail::DoCreateOrOpen
          , size
          , mode
          , addr
@@ -258,7 +258,7 @@
 
    template <class ConstructFunc> inline 
    void priv_open_or_create
-      (create_enum_t type, std::size_t size,
+      (detail::create_enum_t type, std::size_t size,
        mode_t mode, const void *addr,
        ConstructFunc construct_func)
    {
@@ -268,20 +268,20 @@
       bool created = false;
       DeviceAbstraction dev;
 
-      if(type != DoOpen && size < ManagedOpenOrCreateUserOffset){
+      if(type != detail::DoOpen && size < ManagedOpenOrCreateUserOffset){
          throw interprocess_exception(error_info(size_error));
       }
 
-      if(type == DoOpen){
+      if(type == detail::DoOpen){
          DeviceAbstraction tmp(open_only, m_name.c_str(), read_write);
          tmp.swap(dev);
          created = false;
       }
-      else if(type == DoCreate){
+      else if(type == detail::DoCreate){
          create_device<FileBased>(dev, m_name.c_str(), size, file_like_t());
          created = true;
       }
-      else if(type == DoCreateOrOpen){
+      else if(type == detail::DoCreateOrOpen){
          //This loop is very ugly, but brute force is sometimes better
          //than diplomacy. If someone knows how to open or create a
          //file and know if we have really created it or just open it


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to