Ticket #1932: interprocess_movable.patch
File interprocess_movable.patch, 8.5 KB (added by , 14 years ago) |
---|
-
file_mapping.hpp
55 55 //!After the call, "moved" does not represent any shared memory object. 56 56 //!Does not throw 57 57 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 58 file_mapping( detail::moved_object<file_mapping> &moved)58 file_mapping(const detail::moved_object<file_mapping> &moved) 59 59 { this->swap(moved.get()); } 60 60 #else 61 61 file_mapping(file_mapping &&moved) … … 67 67 //!Does not throw 68 68 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 69 69 file_mapping &operator= 70 ( detail::moved_object<file_mapping> &moved)70 (const detail::moved_object<file_mapping> &moved) 71 71 { 72 72 file_mapping tmp(moved); 73 73 this->swap(tmp); … … 165 165 } 166 166 } 167 167 168 //!This class is movable 169 template <> 170 struct is_movable<file_mapping> 171 { 172 enum { value = true }; 173 }; 174 168 175 } //namespace interprocess { 169 176 } //namespace boost { 170 177 -
windows_shared_memory.hpp
83 83 //!Does not throw 84 84 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 85 85 windows_shared_memory 86 ( detail::moved_object<windows_shared_memory> &moved)86 (const detail::moved_object<windows_shared_memory> &moved) 87 87 { this->swap(moved.get()); } 88 88 #else 89 89 windows_shared_memory(windows_shared_memory &&moved) … … 95 95 //!Does not throw 96 96 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 97 97 windows_shared_memory &operator= 98 ( detail::moved_object<windows_shared_memory> &moved)98 (const detail::moved_object<windows_shared_memory> &moved) 99 99 { 100 100 windows_shared_memory tmp(moved); 101 101 this->swap(tmp); … … 235 235 } 236 236 } 237 237 238 //!This class is movable 239 template <> 240 struct is_movable<windows_shared_memory> 241 { 242 enum { value = true }; 243 }; 244 238 245 } //namespace interprocess { 239 246 } //namespace boost { 240 247 -
mapped_region.hpp
79 79 //!Move constructor. *this will be constructed taking ownership of "other"'s 80 80 //!region and "other" will be left in default constructor state. 81 81 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 82 mapped_region( detail::moved_object<mapped_region>other);82 mapped_region(const detail::moved_object<mapped_region> &other); 83 83 #else 84 84 mapped_region(mapped_region &&other); 85 85 #endif … … 91 91 //!Move assignment. If *this owns a memory mapped region, it will be 92 92 //!destroyed and it will take ownership of "other"'s memory mapped region. 93 93 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 94 mapped_region &operator=( detail::moved_object<mapped_region>other);94 mapped_region &operator=(const detail::moved_object<mapped_region> &other); 95 95 #else 96 96 mapped_region &operator=(mapped_region &&other); 97 97 #endif … … 151 151 { x.swap(y); } 152 152 153 153 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 154 inline mapped_region &mapped_region::operator=( detail::moved_object<mapped_region>other)154 inline mapped_region &mapped_region::operator=(const detail::moved_object<mapped_region> &other) 155 155 { this->swap(other.get()); return *this; } 156 156 #else 157 157 inline mapped_region &mapped_region::operator=(mapped_region &&other) … … 178 178 {} 179 179 180 180 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 181 inline mapped_region::mapped_region( detail::moved_object<mapped_region>other)181 inline mapped_region::mapped_region(const detail::moved_object<mapped_region> &other) 182 182 : m_base(0), m_size(0), m_offset(0) 183 183 , m_extra_offset(0) 184 184 , m_file_mapping_hnd(detail::invalid_file()) … … 382 382 {} 383 383 384 384 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 385 inline mapped_region::mapped_region( detail::moved_object<mapped_region>other)385 inline mapped_region::mapped_region(const detail::moved_object<mapped_region> &other) 386 386 : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0) 387 387 { this->swap(other.get()); } 388 388 #else … … 555 555 }; 556 556 /// @endcond 557 557 558 //!This class is movable 559 template <> 560 struct is_movable<mapped_region> 561 { 562 enum { value = true }; 563 }; 564 558 565 } //namespace interprocess { 559 566 } //namespace boost { 560 567 -
managed_heap_memory.hpp
72 72 //!Moves the ownership of "moved"'s managed memory to *this. Does not throw 73 73 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 74 74 basic_managed_heap_memory 75 ( detail::moved_object<basic_managed_heap_memory> &moved)75 (const detail::moved_object<basic_managed_heap_memory> &moved) 76 76 { this->swap(moved.get()); } 77 77 #else 78 78 basic_managed_heap_memory(basic_managed_heap_memory &&moved) … … 82 82 //!Moves the ownership of "moved"'s managed memory to *this. Does not throw 83 83 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 84 84 basic_managed_heap_memory &operator= 85 ( detail::moved_object<basic_managed_heap_memory> &moved)85 (const detail::moved_object<basic_managed_heap_memory> &moved) 86 86 { this->swap(moved.get()); return *this; } 87 87 #else 88 88 basic_managed_heap_memory &operator= … … 139 139 /// @endcond 140 140 }; 141 141 142 template 143 < 144 class CharType, 145 class AllocationAlgorithm, 146 template<class IndexConfig> class IndexType 147 > 148 struct is_movable<basic_managed_heap_memory<CharType, AllocationAlgorithm, 149 IndexType> > 150 { 151 enum { value = true }; 152 }; 153 142 154 } //namespace interprocess { 143 155 144 156 } //namespace boost { -
shared_memory_object.hpp
76 76 //!Does not throw 77 77 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 78 78 shared_memory_object 79 ( detail::moved_object<shared_memory_object> &moved)79 (const detail::moved_object<shared_memory_object> &moved) 80 80 { this->swap(moved.get()); } 81 81 #else 82 82 shared_memory_object(shared_memory_object &&moved) … … 88 88 //!Does not throw 89 89 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 90 90 shared_memory_object &operator= 91 ( detail::moved_object<shared_memory_object> &moved)91 (const detail::moved_object<shared_memory_object> &moved) 92 92 { 93 93 shared_memory_object tmp(moved); 94 94 this->swap(tmp); … … 341 341 342 342 #endif 343 343 344 //!This class is movable 345 template <> 346 struct is_movable<shared_memory_object> 347 { 348 enum { value = true }; 349 }; 350 344 351 } //namespace interprocess { 345 352 } //namespace boost { 346 353 -
managed_external_buffer.hpp
46 46 /// @endcond 47 47 48 48 public: 49 //!Constructor. Allocates basic resources. Never throws. 50 basic_managed_external_buffer() {} 51 49 52 //!Creates and places the segment manager. This can throw 50 53 basic_managed_external_buffer 51 54 (create_only_t, void *addr, std::size_t size) … … 71 74 //!Moves the ownership of "moved"'s managed memory to *this. Does not throw 72 75 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 73 76 basic_managed_external_buffer 74 ( detail::moved_object<basic_managed_external_buffer> &moved)77 (const detail::moved_object<basic_managed_external_buffer> &moved) 75 78 { this->swap(moved.get()); } 76 79 #else 77 80 basic_managed_external_buffer … … 82 85 //!Moves the ownership of "moved"'s managed memory to *this. Does not throw 83 86 #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE 84 87 basic_managed_external_buffer &operator= 85 ( detail::moved_object<basic_managed_external_buffer> &moved)88 (const detail::moved_object<basic_managed_external_buffer> &moved) 86 89 { this->swap(moved.get()); return *this; } 87 90 #else 88 91 basic_managed_external_buffer &operator= … … 100 103 101 104 }; 102 105 106 template 107 < 108 class CharType, 109 class AllocationAlgorithm, 110 template<class IndexConfig> class IndexType 111 > 112 struct is_movable<basic_managed_external_buffer<CharType, AllocationAlgorithm, 113 IndexType> > 114 { 115 enum { value = true }; 116 }; 117 103 118 } //namespace interprocess { 104 119 } //namespace boost { 105 120