Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:28

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
0004 // Software License, Version 1.0. (See accompanying file
0005 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/interprocess for documentation.
0008 //
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #ifndef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP
0012 #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP
0013 
0014 #ifndef BOOST_CONFIG_HPP
0015 #  include <boost/config.hpp>
0016 #endif
0017 #
0018 #if defined(BOOST_HAS_PRAGMA_ONCE)
0019 #  pragma once
0020 #endif
0021 
0022 #include <boost/interprocess/detail/config_begin.hpp>
0023 #include <boost/interprocess/detail/workaround.hpp>
0024 #include <boost/detail/workaround.hpp>
0025 
0026 #if !defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
0027 #error "This header can't be used in operating systems without XSI (System V) shared memory support"
0028 #endif
0029 
0030 #include <boost/interprocess/creation_tags.hpp>
0031 #include <boost/interprocess/exceptions.hpp>
0032 #include <boost/interprocess/detail/utilities.hpp>
0033 #include <boost/interprocess/detail/os_file_functions.hpp>
0034 #include <boost/interprocess/detail/shared_dir_helpers.hpp>
0035 #include <boost/interprocess/interprocess_fwd.hpp>
0036 #include <boost/interprocess/exceptions.hpp>
0037 
0038 #include <boost/interprocess/xsi_shared_memory.hpp>
0039 
0040 //!\file
0041 //!Describes a class representing a pseudo-file implemented on top of xsi shared memory.
0042 
0043 namespace boost {
0044 namespace interprocess {
0045 
0046 class xsi_shared_memory_file_wrapper
0047    : public xsi_shared_memory
0048 {
0049    #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0050    BOOST_MOVABLE_BUT_NOT_COPYABLE(xsi_shared_memory_file_wrapper)
0051    #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0052    public:
0053 
0054    xsi_shared_memory_file_wrapper() : xsi_shared_memory() {}
0055 
0056    xsi_shared_memory_file_wrapper(create_only_t, const xsi_key &key, mode_t , std::size_t size, const permissions& perm = permissions())
0057       : xsi_shared_memory(create_only_t(), key, size, perm.get_permissions())
0058    {}
0059 
0060    xsi_shared_memory_file_wrapper(open_or_create_t, const xsi_key &key, mode_t , std::size_t size, const permissions& perm = permissions())
0061       : xsi_shared_memory(open_or_create_t(), key, size, perm.get_permissions())
0062    {}
0063 
0064    xsi_shared_memory_file_wrapper(open_only_t, const xsi_key &key, mode_t, const permissions& = permissions())
0065       : xsi_shared_memory(open_only_t(), key)
0066    {}
0067 
0068    xsi_shared_memory_file_wrapper(BOOST_RV_REF(xsi_shared_memory_file_wrapper) moved)
0069    {  this->swap(moved);   }
0070 
0071    xsi_shared_memory_file_wrapper &operator=(BOOST_RV_REF(xsi_shared_memory_file_wrapper) moved)
0072    {
0073       xsi_shared_memory_file_wrapper tmp(boost::move(moved));
0074       this->swap(tmp);
0075       return *this;
0076    }
0077 
0078    //!Swaps two xsi_shared_memory_file_wrapper. Does not throw
0079    void swap(xsi_shared_memory_file_wrapper &other)
0080    {  this->xsi_shared_memory::swap(other);  }
0081 };
0082 
0083 }  //namespace interprocess {
0084 }  //namespace boost {
0085 
0086 #include <boost/interprocess/detail/config_end.hpp>
0087 
0088 #endif   //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_FILE_WRAPPER_HPP