1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP
12 #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP
14 #ifndef BOOST_CONFIG_HPP
15 # include <boost/config.hpp>
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
22 #include <boost/interprocess/detail/config_begin.hpp>
23 #include <boost/interprocess/detail/workaround.hpp>
24 #include <boost/detail/workaround.hpp>
26 #if !defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
27 #error "This header can't be used in operating systems without XSI (System V) shared memory support"
30 #include <boost/interprocess/creation_tags.hpp>
31 #include <boost/interprocess/exceptions.hpp>
32 #include <boost/interprocess/detail/utilities.hpp>
33 #include <boost/interprocess/detail/os_file_functions.hpp>
34 #include <boost/interprocess/detail/shared_dir_helpers.hpp>
35 #include <boost/interprocess/interprocess_fwd.hpp>
36 #include <boost/interprocess/exceptions.hpp>
38 #include <boost/interprocess/xsi_shared_memory.hpp>
41 //!Describes a class representing a pseudo-file implemented on top of xsi shared memory.
44 namespace interprocess {
46 class xsi_shared_memory_file_wrapper
47 : public xsi_shared_memory
49 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
50 BOOST_MOVABLE_BUT_NOT_COPYABLE(xsi_shared_memory_file_wrapper)
51 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
54 xsi_shared_memory_file_wrapper() : xsi_shared_memory() {}
56 xsi_shared_memory_file_wrapper(create_only_t, const xsi_key &key, mode_t , std::size_t size, const permissions& perm = permissions())
57 : xsi_shared_memory(create_only_t(), key, size, perm.get_permissions())
60 xsi_shared_memory_file_wrapper(open_or_create_t, const xsi_key &key, mode_t , std::size_t size, const permissions& perm = permissions())
61 : xsi_shared_memory(open_or_create_t(), key, size, perm.get_permissions())
64 xsi_shared_memory_file_wrapper(open_only_t, const xsi_key &key, mode_t, const permissions& = permissions())
65 : xsi_shared_memory(open_only_t(), key)
68 xsi_shared_memory_file_wrapper(BOOST_RV_REF(xsi_shared_memory_file_wrapper) moved)
69 { this->swap(moved); }
71 xsi_shared_memory_file_wrapper &operator=(BOOST_RV_REF(xsi_shared_memory_file_wrapper) moved)
73 xsi_shared_memory_file_wrapper tmp(boost::move(moved));
78 //!Swaps two xsi_shared_memory_file_wrapper. Does not throw
79 void swap(xsi_shared_memory_file_wrapper &other)
80 { this->xsi_shared_memory::swap(other); }
83 } //namespace interprocess {
86 #include <boost/interprocess/detail/config_end.hpp>
88 #endif //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP