Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74158 - in sandbox/mmap/boost/mmap: . mappble_objects/file mappble_objects/file/posix mappble_objects/file/win32 mapped_view mapped_view/nt mapped_view/posix mapped_view/win32 mapping/posix mapping/win32
From: dsaritz_at_[hidden]
Date: 2011-08-30 09:46:08


Author: psiha
Date: 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
New Revision: 74158
URL: http://svn.boost.org/trac/boost/changeset/74158

Log:
Fixed header-only compilation:
 - added include guards to .inl files (not yet complete)
 - moved mapped_view implementation details (detail::mapper<> specializations) from mapping.inl files into new mapped_view.inl files and moved the mapped_view related files to a separate directory.

Fixed Clang compilation errors in posix/mapped_view.inl.
Added:
   sandbox/mmap/boost/mmap/mapped_view/ (props changed)
   sandbox/mmap/boost/mmap/mapped_view/mapped_view.hpp
      - copied, changed from r74144, /sandbox/mmap/boost/mmap/mapped_view.hpp
   sandbox/mmap/boost/mmap/mapped_view/mapped_view.inl
      - copied, changed from r74144, /sandbox/mmap/boost/mmap/mapped_view.inl
   sandbox/mmap/boost/mmap/mapped_view/nt/
      - copied from r74144, /sandbox/mmap/boost/mmap/mapping/nt/
   sandbox/mmap/boost/mmap/mapped_view/posix/
      - copied from r74144, /sandbox/mmap/boost/mmap/mapping/posix/
   sandbox/mmap/boost/mmap/mapped_view/posix/mapped_view.inl
      - copied, changed from r74144, /sandbox/mmap/boost/mmap/mapping/posix/mapping.inl
   sandbox/mmap/boost/mmap/mapped_view/win32/
      - copied from r74144, /sandbox/mmap/boost/mmap/mapping/win32/
   sandbox/mmap/boost/mmap/mapped_view/win32/mapped_view.inl
      - copied, changed from r74144, /sandbox/mmap/boost/mmap/mapping/win32/mapping.inl
Removed:
   sandbox/mmap/boost/mmap/mapped_view.hpp
   sandbox/mmap/boost/mmap/mapped_view.inl
   sandbox/mmap/boost/mmap/mapped_view/posix/mapping.hpp
   sandbox/mmap/boost/mmap/mapped_view/posix/mapping.inl
   sandbox/mmap/boost/mmap/mapped_view/win32/mapping.hpp
   sandbox/mmap/boost/mmap/mapped_view/win32/mapping.inl
Text files modified:
   sandbox/mmap/boost/mmap/mappble_objects/file/posix/file.inl | 6 ++
   sandbox/mmap/boost/mmap/mappble_objects/file/posix/mapping_flags.inl | 6 ++
   sandbox/mmap/boost/mmap/mappble_objects/file/posix/open_flags.inl | 6 ++
   sandbox/mmap/boost/mmap/mappble_objects/file/utility.hpp | 2
   sandbox/mmap/boost/mmap/mappble_objects/file/win32/file.inl | 6 ++
   sandbox/mmap/boost/mmap/mappble_objects/file/win32/mapping_flags.inl | 6 ++
   sandbox/mmap/boost/mmap/mappble_objects/file/win32/open_flags.inl | 6 ++
   sandbox/mmap/boost/mmap/mapped_view/mapped_view.hpp | 6 +-
   sandbox/mmap/boost/mmap/mapped_view/mapped_view.inl | 15 ------
   sandbox/mmap/boost/mmap/mapped_view/posix/mapped_view.inl | 87 ++++++++++++++++++++-------------------
   sandbox/mmap/boost/mmap/mapped_view/win32/mapped_view.inl | 6 +-
   sandbox/mmap/boost/mmap/mapping/posix/mapping.inl | 49 ----------------------
   sandbox/mmap/boost/mmap/mapping/win32/mapping.inl | 53 ------------------------
   13 files changed, 89 insertions(+), 165 deletions(-)

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/posix/file.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/posix/file.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/posix/file.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef file_inl__1E2F9841_1C6C_40D9_9AA7_BAC0003CD909
+#define file_inl__1E2F9841_1C6C_40D9_9AA7_BAC0003CD909
+#pragma once
+//------------------------------------------------------------------------------
 #include "file.hpp"
 
 #include "open_flags.hpp"
@@ -111,3 +115,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // file_inl
\ No newline at end of file

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/posix/mapping_flags.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/posix/mapping_flags.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/posix/mapping_flags.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef mapping_flags_inl__79CF82B8_F71B_4C75_BE77_98F4FB8A7FFA
+#define mapping_flags_inl__79CF82B8_F71B_4C75_BE77_98F4FB8A7FFA
+#pragma once
+//------------------------------------------------------------------------------
 #include "mapping_flags.hpp"
 //------------------------------------------------------------------------------
 namespace boost
@@ -42,3 +46,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // mapping_flags.inl
\ No newline at end of file

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/posix/open_flags.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/posix/open_flags.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/posix/open_flags.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef open_flags_inl__0F422517_D9AA_4E3F_B3E4_B139021D068E
+#define open_flags_inl__0F422517_D9AA_4E3F_B3E4_B139021D068E
+#pragma once
+//------------------------------------------------------------------------------
 #include "open_flags.hpp"
 
 #include "../../../detail/impl_inline.hpp"
@@ -85,3 +89,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // open_flags_inl
\ No newline at end of file

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/utility.hpp
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/utility.hpp (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/utility.hpp 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -17,7 +17,7 @@
 #define utility_hpp__3713A8AF_A516_4A23_BE6A_2BB79EBF7B5F
 #pragma once
 //------------------------------------------------------------------------------
-#include "../../mapped_view.hpp"
+#include "../../mapped_view/mapped_view.hpp"
 
 #include <cstddef>
 //------------------------------------------------------------------------------

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/win32/file.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/win32/file.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/win32/file.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef file_inl__FB482005_18D9_4E3B_9193_A13DBFE88F45
+#define file_inl__FB482005_18D9_4E3B_9193_A13DBFE88F45
+#pragma once
+//------------------------------------------------------------------------------
 #include "file.hpp"
 
 #include "open_flags.hpp"
@@ -158,3 +162,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // file_inl

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/win32/mapping_flags.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/win32/mapping_flags.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/win32/mapping_flags.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef mapping_flags_inl__CD518463_D4CB_4E18_8E35_E0FBBA8CA1D1
+#define mapping_flags_inl__CD518463_D4CB_4E18_8E35_E0FBBA8CA1D1
+#pragma once
+//------------------------------------------------------------------------------
 #include "mapping_flags.hpp"
 
 #include "../../../detail/windows.hpp"
@@ -65,3 +69,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // mapping_flags.inl
\ No newline at end of file

Modified: sandbox/mmap/boost/mmap/mappble_objects/file/win32/open_flags.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mappble_objects/file/win32/open_flags.inl (original)
+++ sandbox/mmap/boost/mmap/mappble_objects/file/win32/open_flags.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,6 +13,10 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
+#ifndef open_flags_inl__77AE8A6F_0E93_433B_A1F2_531BBBB353FC
+#define open_flags_inl__77AE8A6F_0E93_433B_A1F2_531BBBB353FC
+#pragma once
+//------------------------------------------------------------------------------
 #include "open_flags.hpp"
 
 #include "../../detail/impl_inline.hpp"
@@ -96,3 +100,5 @@
 //------------------------------------------------------------------------------
 } // boost
 //------------------------------------------------------------------------------
+
+#endif // open_flags_inl
\ No newline at end of file

Deleted: sandbox/mmap/boost/mmap/mapped_view.hpp
==============================================================================
--- sandbox/mmap/boost/mmap/mapped_view.hpp 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,231 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapped_view.hpp
-/// ---------------------
-///
-/// Copyright (c) Domagoj Saric 2010.-2011.
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#ifndef mapped_view_hpp__D9C84FF5_E506_4ECB_9778_61E036048D28
-#define mapped_view_hpp__D9C84FF5_E506_4ECB_9778_61E036048D28
-#pragma once
-//------------------------------------------------------------------------------
-#include "detail/impl_selection.hpp"
-#include "handles/handle.hpp"
-#include "mapping/mapping.hpp"
-
-#include "boost/assert.hpp"
-#include "boost/cstdint.hpp"
-#include "boost/noncopyable.hpp"
-#include "boost/range/iterator_range_core.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-typedef iterator_range<char *> basic_memory_range_t;
-typedef iterator_range<char const *> basic_read_only_memory_range_t;
-
-template <typename Element, typename Impl = BOOST_MMAP_IMPL()>
-class mapped_view_reference;
-
-typedef mapped_view_reference<char > basic_mapped_view_ref;
-typedef mapped_view_reference<char const> basic_mapped_read_only_view_ref;
-
-namespace detail
-{
- template <typename Element, typename Impl>
- struct mapper
- {
- public:
- static mapped_view_reference<Element, Impl> map
- (
- mapping<Impl> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
- {
- return make_typed_view( mapper<char, Impl>::map( source_mapping, offset, desired_size ) );
- }
-
- static void unmap( mapped_view_reference<Element, Impl> const & view )
- {
- mapper<char, Impl>::unmap( make_basic_view( view ) );
- }
-
- private:
- static mapped_view_reference<char, Impl>
- #ifdef BOOST_MSVC
- const &
- #endif
- make_basic_view( mapped_view_reference<Element, Impl> const & );
-
- static mapped_view_reference<Element, Impl>
- #ifdef BOOST_MSVC
- const &
- #endif
- make_typed_view( mapped_view_reference<char, Impl> const & );
- };
-
- template <typename Impl>
- struct mapper<char, Impl>
- {
- static mapped_view_reference<char, Impl> map
- (
- mapping<Impl> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- );
-
- static void unmap( mapped_view_reference<char, Impl> const & );
- };
-} // namespace detail
-
-template <typename Impl> struct mapping;
-
-template <typename Element, typename Impl>
-class mapped_view_reference : public iterator_range<Element *>
-{
-public:
- typedef iterator_range<Element *> memory_range_t;
-
-public: // Factory methods.
- static mapped_view_reference map
- (
- mapping<Impl> const & source_mapping,
- boost::uint64_t offset = 0,
- std ::size_t desired_size = 0
- )
- {
- BOOST_ASSERT_MSG
- (
- !boost::is_const<Element>::value || source_mapping.is_read_only(),
- "Use const element mapped view for read only mappings."
- );
- return detail::mapper<Element, Impl>::map( source_mapping, offset, desired_size );
- }
-
- static void unmap( mapped_view_reference const & view )
- {
- detail::mapper<Element, Impl>::unmap( view );
- }
-
-private: template <typename Element_, typename Impl_> friend struct detail::mapper;
- mapped_view_reference( iterator_range<Element *> const & mapped_range ) : iterator_range<Element *>( mapped_range ) {}
- mapped_view_reference( Element * const p_begin, Element * const p_end ) : iterator_range<Element *>( p_begin, p_end ) {}
-
-private: // Hide mutable members
- void advance_begin();
- void advance_end ();
-
- void pop_front();
- void pop_back ();
-};
-
-
-namespace detail
-{
- // Implementation note:
- // These have to be defined after mapped_view_reference for eager
- // compilers (e.g. GCC and Clang).
- // (14.07.2011.) (Domagoj Saric)
-
- template <typename Element, typename Impl>
- mapped_view_reference<char, Impl>
- #ifdef BOOST_MSVC
- const &
- #endif
- mapper<Element, Impl>::make_basic_view( mapped_view_reference<Element, Impl> const & range )
- {
- return
- #ifdef BOOST_MSVC
- reinterpret_cast<mapped_view_reference<char, Impl> const &>( range );
- #else // compiler might care about strict aliasing rules
- mapped_view_reference<char, Impl>
- (
- static_cast<char *>( const_cast<void *>( static_cast<void const *>( range.begin() ) ) ),
- static_cast<char *>( const_cast<void *>( static_cast<void const *>( range.end () ) ) )
- );
- #endif // compiler
- }
-
-
- template <typename Element, typename Impl>
- mapped_view_reference<Element, Impl>
- #ifdef BOOST_MSVC
- const &
- #endif
- mapper<Element, Impl>::make_typed_view( mapped_view_reference<char, Impl> const & range )
- {
- //...zzz...add proper error handling...
- BOOST_ASSERT( reinterpret_cast<std::size_t>( range.begin() ) % sizeof( Element ) == 0 );
- BOOST_ASSERT( reinterpret_cast<std::size_t>( range.end () ) % sizeof( Element ) == 0 );
- BOOST_ASSERT( range.size () % sizeof( Element ) == 0 );
- return
- #ifdef BOOST_MSVC
- reinterpret_cast<mapped_view_reference<Element, Impl> const &>( range );
- #else // compiler might care about strict aliasing rules
- mapped_view_reference<Element, Impl>
- (
- static_cast<Element *>( static_cast<void *>( range.begin() ) ),
- static_cast<Element *>( static_cast<void *>( range.end () ) )
- );
- #endif // compiler
- }
-} // namespace detail
-
-
-template <typename Handle>
-struct is_mappable : mpl::false_ {};
-
-template <> struct is_mappable<char *> : mpl::true_ {};
-template <> struct is_mappable<char const *> : mpl::true_ {};
-template <> struct is_mappable<FILE *> : mpl::true_ {};
-template <> struct is_mappable<handle<posix>::native_handle_t > : mpl::true_ {};
-#ifdef _WIN32
-template <> struct is_mappable<wchar_t *> : mpl::true_ {};
-template <> struct is_mappable<wchar_t const *> : mpl::true_ {};
-template <> struct is_mappable<handle<win32>::native_handle_t > : mpl::true_ {};
-#endif // _WIN32
-
-
-template <typename Element, typename Impl = BOOST_MMAP_IMPL()>
-class mapped_view
- :
- public mapped_view_reference<Element, Impl>
- #ifdef BOOST_MSVC
- ,private noncopyable
- #endif // BOOST_MSVC
-{
-public:
- mapped_view( mapped_view_reference<Element, Impl> const range ) : mapped_view_reference<Element, Impl>( range ) {}
- ~mapped_view() { mapped_view_reference<Element, Impl>::unmap( *this ); }
-
- #ifndef BOOST_MSVC
- mapped_view( mapped_view const & ); // noncopyable
- #endif // BOOST_MSVC
-};
-
-typedef mapped_view<char> basic_mapped_view;
-
-//------------------------------------------------------------------------------
-} // namespace mmap
-//------------------------------------------------------------------------------
-} // namespace boost
-//------------------------------------------------------------------------------
-
-#ifdef BOOST_MMAP_HEADER_ONLY
- #include "mapped_view.inl"
-#endif
-
-#endif // mapped_view_hpp

Deleted: sandbox/mmap/boost/mmap/mapped_view.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mapped_view.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,30 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapped_view.inl
-/// ---------------------
-///
-/// Copyright (c) Domagoj Saric 2010.-2011.
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#include "mapped_view.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-} // mmap
-//------------------------------------------------------------------------------
-} // boost
-//------------------------------------------------------------------------------

Copied: sandbox/mmap/boost/mmap/mapped_view/mapped_view.hpp (from r74144, /sandbox/mmap/boost/mmap/mapped_view.hpp)
==============================================================================
--- /sandbox/mmap/boost/mmap/mapped_view.hpp (original)
+++ sandbox/mmap/boost/mmap/mapped_view/mapped_view.hpp 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -17,9 +17,9 @@
 #define mapped_view_hpp__D9C84FF5_E506_4ECB_9778_61E036048D28
 #pragma once
 //------------------------------------------------------------------------------
-#include "detail/impl_selection.hpp"
-#include "handles/handle.hpp"
-#include "mapping/mapping.hpp"
+#include "../detail/impl_selection.hpp"
+#include "../handles/handle.hpp"
+#include "../mapping/mapping.hpp"
 
 #include "boost/assert.hpp"
 #include "boost/cstdint.hpp"

Copied: sandbox/mmap/boost/mmap/mapped_view/mapped_view.inl (from r74144, /sandbox/mmap/boost/mmap/mapped_view.inl)
==============================================================================
--- /sandbox/mmap/boost/mmap/mapped_view.inl (original)
+++ sandbox/mmap/boost/mmap/mapped_view/mapped_view.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -13,18 +13,5 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
-#include "mapped_view.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-} // mmap
-//------------------------------------------------------------------------------
-} // boost
+#include BOOST_MMAP_IMPL_INCLUDE( BOOST_PP_EMPTY, BOOST_PP_IDENTITY( /mapped_view.inl ) )
 //------------------------------------------------------------------------------

Copied: sandbox/mmap/boost/mmap/mapped_view/posix/mapped_view.inl (from r74144, /sandbox/mmap/boost/mmap/mapping/posix/mapping.inl)
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/posix/mapping.inl (original)
+++ sandbox/mmap/boost/mmap/mapped_view/posix/mapped_view.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -1,7 +1,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 ///
-/// \file mapping.inl
-/// -----------------
+/// \file mapped_view.inl
+/// ---------------------
 ///
 /// Copyright (c) Domagoj Saric 2010.-2011.
 ///
@@ -13,7 +13,7 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
-#include "mapping.hpp"
+#include "../mapped_view.hpp"
 
 #include "../../detail/posix.hpp"
 //------------------------------------------------------------------------------
@@ -24,52 +24,55 @@
 {
 //------------------------------------------------------------------------------
 
-template <>
-struct detail::mapper<char, posix>
+namespace detail
 {
- static mapped_view_reference<char, posix> map
- (
- mapping<posix> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
+ template <>
+ struct mapper<char, posix>
     {
- typedef mapped_view_reference<char, posix>::iterator iterator;
-
- iterator const view_start
+ static mapped_view_reference<char, posix> map
         (
- static_cast<iterator>
+ mapping<posix> const & source_mapping,
+ boost::uint64_t offset ,
+ std ::size_t desired_size
+ )
+ {
+ typedef mapped_view_reference<char, posix>::iterator iterator;
+
+ iterator const view_start
             (
- ::mmap
+ static_cast<iterator>
                 (
- 0,
- desired_size,
- source_mapping.view_mapping_flags.protection,
- source_mapping.view_mapping_flags.flags,
- source_mapping,
- offset
+ ::mmap
+ (
+ 0,
+ desired_size,
+ source_mapping.view_mapping_flags.protection,
+ source_mapping.view_mapping_flags.flags,
+ source_mapping,
+ offset
+ )
                 )
- )
- );
-
- return mapped_view_reference<char>
- (
- view_start,
- ( view_start != MAP_FAILED )
- ? view_start + desired_size
- : view_start
- );
- }
+ );
 
- static void unmap( mapped_view_reference<char, posix> const & view )
- {
- BOOST_VERIFY
- (
- ( ::munmap( view.begin(), view.size() ) == 0 ) ||
- view.empty()
- );
- }
-};
+ return mapped_view_reference<char>
+ (
+ view_start,
+ ( view_start != MAP_FAILED )
+ ? view_start + desired_size
+ : view_start
+ );
+ }
+
+ static void unmap( mapped_view_reference<char, posix> const & view )
+ {
+ BOOST_VERIFY
+ (
+ ( ::munmap( view.begin(), view.size() ) == 0 ) ||
+ view.empty()
+ );
+ }
+ };
+} // namespace detail
 
 //------------------------------------------------------------------------------
 } // mmap

Deleted: /sandbox/mmap/boost/mmap/mapping/posix/mapping.hpp
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/posix/mapping.hpp 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,62 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapping.hpp
-/// -----------------
-///
-/// Copyright (c) 2011 Domagoj Saric
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#ifndef mapping_hpp__99837E03_86B1_42F5_A57D_69A6E828DD08
-#define mapping_hpp__99837E03_86B1_42F5_A57D_69A6E828DD08
-#pragma once
-//------------------------------------------------------------------------------
-#include "../../handles/posix/handle.hpp"
-#include "../../mappble_objects/file/posix/mapping_flags.hpp"
-
-#include "boost/config/suffix.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-template <typename Impl> struct mapping;
-
-template <>
-struct mapping<posix>
- :
- handle<posix>::reference
-{
- typedef handle<posix>::native_handle_t native_handle_t;
- typedef mapping const & reference;
-
- BOOST_STATIC_CONSTANT( bool, owns_parent_handle = false );
-
- mapping( native_handle_t const native_handle, file_mapping_flags<posix> const & view_mapping_flags_param )
- : handle<posix>::reference( native_handle ), view_mapping_flags( view_mapping_flags_param ) {}
-
- bool is_read_only() const { return ( view_mapping_flags.protection & file_mapping_flags<posix>::handle_access_rights::write ) == 0; }
-
- file_mapping_flags<posix> const view_mapping_flags;
-};
-
-//------------------------------------------------------------------------------
-} // namespace mmap
-//------------------------------------------------------------------------------
-} // namespace boost
-//------------------------------------------------------------------------------
-
-#ifdef BOOST_MMAP_HEADER_ONLY
- #include "mapping.inl"
-#endif // BOOST_MMAP_HEADER_ONLY
-
-#endif // mapping_hpp

Deleted: /sandbox/mmap/boost/mmap/mapping/posix/mapping.inl
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/posix/mapping.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,78 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapping.inl
-/// -----------------
-///
-/// Copyright (c) Domagoj Saric 2010.-2011.
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#include "mapping.hpp"
-
-#include "../../detail/posix.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-template <>
-struct detail::mapper<char, posix>
-{
- static mapped_view_reference<char, posix> map
- (
- mapping<posix> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
- {
- typedef mapped_view_reference<char, posix>::iterator iterator;
-
- iterator const view_start
- (
- static_cast<iterator>
- (
- ::mmap
- (
- 0,
- desired_size,
- source_mapping.view_mapping_flags.protection,
- source_mapping.view_mapping_flags.flags,
- source_mapping,
- offset
- )
- )
- );
-
- return mapped_view_reference<char>
- (
- view_start,
- ( view_start != MAP_FAILED )
- ? view_start + desired_size
- : view_start
- );
- }
-
- static void unmap( mapped_view_reference<char, posix> const & view )
- {
- BOOST_VERIFY
- (
- ( ::munmap( view.begin(), view.size() ) == 0 ) ||
- view.empty()
- );
- }
-};
-
-//------------------------------------------------------------------------------
-} // mmap
-//------------------------------------------------------------------------------
-} // boost
-//------------------------------------------------------------------------------

Copied: sandbox/mmap/boost/mmap/mapped_view/win32/mapped_view.inl (from r74144, /sandbox/mmap/boost/mmap/mapping/win32/mapping.inl)
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/win32/mapping.inl (original)
+++ sandbox/mmap/boost/mmap/mapped_view/win32/mapped_view.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -1,7 +1,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 ///
-/// \file mapping.inl
-/// -----------------
+/// \file mapped_view.inl
+/// ---------------------
 ///
 /// Copyright (c) Domagoj Saric 2010.-2011.
 ///
@@ -13,7 +13,7 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
-#include "mapping.hpp"
+#include "../mapped_view.hpp"
 
 #include "../../detail/windows.hpp"
 //------------------------------------------------------------------------------

Deleted: /sandbox/mmap/boost/mmap/mapping/win32/mapping.hpp
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/win32/mapping.hpp 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,62 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapping.hpp
-/// -----------------
-///
-/// Copyright (c) 2011 Domagoj Saric
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#ifndef mapping_hpp__8B2CEDFB_C87C_4AA4_B9D0_8EF0A42825F2
-#define mapping_hpp__8B2CEDFB_C87C_4AA4_B9D0_8EF0A42825F2
-#pragma once
-//------------------------------------------------------------------------------
-#include "../../handles/win32/handle.hpp"
-#include "../../mappble_objects/file/win32/mapping_flags.hpp"
-
-#include "boost/config/suffix.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-template <typename Impl> struct mapping;
-
-template <>
-struct mapping<win32>
- :
- handle<win32>
-{
- typedef handle<win32>::native_handle_t native_handle_t;
- typedef mapping const & reference;
-
- BOOST_STATIC_CONSTANT( bool, owns_parent_handle = true );
-
- mapping( native_handle_t const native_handle, unsigned int const view_mapping_flags_param )
- : handle<win32>( native_handle ), view_mapping_flags( view_mapping_flags_param ) {}
-
- bool is_read_only() const { return ( view_mapping_flags & file_mapping_flags<win32>::handle_access_rights::write ) == 0; }
-
- unsigned int const view_mapping_flags;
-};
-
-//------------------------------------------------------------------------------
-} // namespace mmap
-//------------------------------------------------------------------------------
-} // namespace boost
-//------------------------------------------------------------------------------
-
-#ifdef BOOST_MMAP_HEADER_ONLY
- #include "mapping.inl"
-#endif // BOOST_MMAP_HEADER_ONLY
-
-#endif // mapping_hpp

Deleted: /sandbox/mmap/boost/mmap/mapping/win32/mapping.inl
==============================================================================
--- /sandbox/mmap/boost/mmap/mapping/win32/mapping.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
+++ (empty file)
@@ -1,82 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file mapping.inl
-/// -----------------
-///
-/// Copyright (c) Domagoj Saric 2010.-2011.
-///
-/// Use, modification and distribution is subject to 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)
-///
-/// For more information, see http://www.boost.org
-///
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#include "mapping.hpp"
-
-#include "../../detail/windows.hpp"
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace mmap
-{
-//------------------------------------------------------------------------------
-
-template <>
-struct detail::mapper<char, win32>
-{
- static mapped_view_reference<char, win32> map
- (
- mapping<win32> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
- {
- // Implementation note:
- // Mapped views hold internal references to the following handles so we do
- // not need to hold/store them ourselves:
- // http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx
- // (26.03.2010.) (Domagoj Saric)
-
- typedef mapped_view_reference<char, win32>::iterator iterator;
-
- ULARGE_INTEGER large_integer;
- large_integer.QuadPart = offset;
-
- iterator const view_start
- (
- static_cast<iterator>
- (
- ::MapViewOfFile
- (
- source_mapping.get(),
- source_mapping.view_mapping_flags,
- large_integer.HighPart,
- large_integer.LowPart,
- desired_size
- )
- )
- );
-
- return mapped_view_reference<char>
- (
- view_start,
- view_start
- ? view_start + desired_size
- : view_start
- );
- }
-
- static void unmap( mapped_view_reference<char, win32> const & view )
- {
- BOOST_VERIFY( ::UnmapViewOfFile( view.begin() ) || view.empty() );
- }
-};
-
-//------------------------------------------------------------------------------
-} // mmap
-//------------------------------------------------------------------------------
-} // boost
-//------------------------------------------------------------------------------

Modified: sandbox/mmap/boost/mmap/mapping/posix/mapping.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mapping/posix/mapping.inl (original)
+++ sandbox/mmap/boost/mmap/mapping/posix/mapping.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -14,8 +14,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
 #include "mapping.hpp"
-
-#include "../../detail/posix.hpp"
 //------------------------------------------------------------------------------
 namespace boost
 {
@@ -24,53 +22,6 @@
 {
 //------------------------------------------------------------------------------
 
-template <>
-struct detail::mapper<char, posix>
-{
- static mapped_view_reference<char, posix> map
- (
- mapping<posix> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
- {
- typedef mapped_view_reference<char, posix>::iterator iterator;
-
- iterator const view_start
- (
- static_cast<iterator>
- (
- ::mmap
- (
- 0,
- desired_size,
- source_mapping.view_mapping_flags.protection,
- source_mapping.view_mapping_flags.flags,
- source_mapping,
- offset
- )
- )
- );
-
- return mapped_view_reference<char>
- (
- view_start,
- ( view_start != MAP_FAILED )
- ? view_start + desired_size
- : view_start
- );
- }
-
- static void unmap( mapped_view_reference<char, posix> const & view )
- {
- BOOST_VERIFY
- (
- ( ::munmap( view.begin(), view.size() ) == 0 ) ||
- view.empty()
- );
- }
-};
-
 //------------------------------------------------------------------------------
 } // mmap
 //------------------------------------------------------------------------------

Modified: sandbox/mmap/boost/mmap/mapping/win32/mapping.inl
==============================================================================
--- sandbox/mmap/boost/mmap/mapping/win32/mapping.inl (original)
+++ sandbox/mmap/boost/mmap/mapping/win32/mapping.inl 2011-08-30 09:46:06 EDT (Tue, 30 Aug 2011)
@@ -14,8 +14,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 //------------------------------------------------------------------------------
 #include "mapping.hpp"
-
-#include "../../detail/windows.hpp"
 //------------------------------------------------------------------------------
 namespace boost
 {
@@ -24,57 +22,6 @@
 {
 //------------------------------------------------------------------------------
 
-template <>
-struct detail::mapper<char, win32>
-{
- static mapped_view_reference<char, win32> map
- (
- mapping<win32> const & source_mapping,
- boost::uint64_t offset ,
- std ::size_t desired_size
- )
- {
- // Implementation note:
- // Mapped views hold internal references to the following handles so we do
- // not need to hold/store them ourselves:
- // http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx
- // (26.03.2010.) (Domagoj Saric)
-
- typedef mapped_view_reference<char, win32>::iterator iterator;
-
- ULARGE_INTEGER large_integer;
- large_integer.QuadPart = offset;
-
- iterator const view_start
- (
- static_cast<iterator>
- (
- ::MapViewOfFile
- (
- source_mapping.get(),
- source_mapping.view_mapping_flags,
- large_integer.HighPart,
- large_integer.LowPart,
- desired_size
- )
- )
- );
-
- return mapped_view_reference<char>
- (
- view_start,
- view_start
- ? view_start + desired_size
- : view_start
- );
- }
-
- static void unmap( mapped_view_reference<char, win32> const & view )
- {
- BOOST_VERIFY( ::UnmapViewOfFile( view.begin() ) || view.empty() );
- }
-};
-
 //------------------------------------------------------------------------------
 } // mmap
 //------------------------------------------------------------------------------


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk