summaryrefslogtreecommitdiff
path: root/boost/interprocess/detail/file_wrapper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/detail/file_wrapper.hpp')
-rw-r--r--boost/interprocess/detail/file_wrapper.hpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/boost/interprocess/detail/file_wrapper.hpp b/boost/interprocess/detail/file_wrapper.hpp
index 586e20db4d..507ec478dc 100644
--- a/boost/interprocess/detail/file_wrapper.hpp
+++ b/boost/interprocess/detail/file_wrapper.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2006-2012. 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)
//
@@ -11,11 +11,15 @@
#ifndef BOOST_INTERPROCESS_DETAIL_FILE_WRAPPER_HPP
#define BOOST_INTERPROCESS_DETAIL_FILE_WRAPPER_HPP
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/detail/os_file_functions.hpp>
#include <boost/interprocess/creation_tags.hpp>
-#include <boost/move/move.hpp>
+#include <boost/move/utility_core.hpp>
#include <boost/interprocess/creation_tags.hpp>
namespace boost {
@@ -24,9 +28,9 @@ namespace ipcdetail{
class file_wrapper
{
- /// @cond
+ #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
BOOST_MOVABLE_BUT_NOT_COPYABLE(file_wrapper)
- /// @endcond
+ #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
//!Default constructor.
@@ -60,10 +64,10 @@ class file_wrapper
//!After the call, "moved" does not represent any file.
//!Does not throw
file_wrapper &operator=(BOOST_RV_REF(file_wrapper) moved)
- {
+ {
file_wrapper tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps to file_wrappers.
@@ -73,7 +77,7 @@ class file_wrapper
//!Erases a file from the system.
//!Returns false on error. Never throws
static bool remove(const char *name);
-
+
//!Sets the size of the file
void truncate(offset_t length);
@@ -122,10 +126,10 @@ inline bool file_wrapper::get_size(offset_t &size) const
{ return get_file_size((file_handle_t)m_handle, size); }
inline void file_wrapper::swap(file_wrapper &other)
-{
+{
std::swap(m_handle, other.m_handle);
std::swap(m_mode, other.m_mode);
- m_filename.swap(other.m_filename);
+ m_filename.swap(other.m_filename);
}
inline mapping_handle_t file_wrapper::get_mapping_handle() const
@@ -167,7 +171,8 @@ inline bool file_wrapper::priv_open_or_create
//Check for error
if(m_handle == invalid_file()){
- throw interprocess_exception(error_info(system_error_code()));
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
}
m_mode = mode;