fix doc example typo
[boost.git] / boost / interprocess / interprocess_fwd.hpp
blob575a2a90a2ba8a9dc432e1b502fb2493292111c2
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2005-2008. 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)
6 //
7 // See http://www.boost.org/libs/interprocess for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_FWD_HPP
12 #define BOOST_INTERPROCESS_FWD_HPP
14 #if defined (_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif
18 #include <boost/interprocess/detail/config_begin.hpp>
19 #include <boost/interprocess/detail/workaround.hpp>
21 #include <cstddef>
23 //////////////////////////////////////////////////////////////////////////////
24 // Standard predeclarations
25 //////////////////////////////////////////////////////////////////////////////
27 /// @cond
29 namespace boost{
30 namespace intrusive{
33 namespace boost{
34 namespace interprocess{
35 namespace bi = boost::intrusive;
38 namespace std {
40 template <class T>
41 class allocator;
43 template <class T>
44 struct less;
46 template <class T1, class T2>
47 struct pair;
49 template <class CharType>
50 struct char_traits;
52 } //namespace std {
54 /// @endcond
56 namespace boost { namespace interprocess {
58 //////////////////////////////////////////////////////////////////////////////
59 // shared_memory
60 //////////////////////////////////////////////////////////////////////////////
62 class shared_memory_object;
64 #if defined (BOOST_INTERPROCESS_WINDOWS)
65 class windows_shared_memory;
66 #endif //#if defined (BOOST_INTERPROCESS_WINDOWS)
68 //////////////////////////////////////////////////////////////////////////////
69 // mapped file/mapped region/mapped_file
70 //////////////////////////////////////////////////////////////////////////////
72 class file_mapping;
73 class mapped_region;
74 class mapped_file;
76 //////////////////////////////////////////////////////////////////////////////
77 // Mutexes
78 //////////////////////////////////////////////////////////////////////////////
80 class null_mutex;
82 class interprocess_mutex;
83 class interprocess_recursive_mutex;
85 class named_mutex;
86 class named_recursive_mutex;
88 class interprocess_semaphore;
89 class named_semaphore;
91 //////////////////////////////////////////////////////////////////////////////
92 // Mutex families
93 //////////////////////////////////////////////////////////////////////////////
95 struct mutex_family;
96 struct null_mutex_family;
98 //////////////////////////////////////////////////////////////////////////////
99 // Other synchronization classes
100 //////////////////////////////////////////////////////////////////////////////
102 class barrier;
103 class interprocess_sharable_mutex;
104 class interprocess_condition;
106 //////////////////////////////////////////////////////////////////////////////
107 // Locks
108 //////////////////////////////////////////////////////////////////////////////
110 template <class Mutex>
111 class scoped_lock;
113 template <class SharableMutex>
114 class sharable_lock;
116 template <class UpgradableMutex>
117 class upgradable_lock;
119 //////////////////////////////////////////////////////////////////////////////
120 // STL compatible allocators
121 //////////////////////////////////////////////////////////////////////////////
123 template<class T, class SegmentManager>
124 class allocator;
126 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
127 class node_allocator;
129 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
130 class private_node_allocator;
132 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
133 class cached_node_allocator;
135 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
136 , unsigned char OverheadPercent = 5
138 class adaptive_pool;
140 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
141 , unsigned char OverheadPercent = 5
143 class private_adaptive_pool;
145 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
146 , unsigned char OverheadPercent = 5
148 class cached_adaptive_pool;
151 //////////////////////////////////////////////////////////////////////////////
152 // offset_ptr
153 //////////////////////////////////////////////////////////////////////////////
155 template <class T>
156 class offset_ptr;
158 //////////////////////////////////////////////////////////////////////////////
159 // Memory allocation algorithms
160 //////////////////////////////////////////////////////////////////////////////
162 //Single segment memory allocation algorithms
163 template<class MutexFamily, class VoidMutex = offset_ptr<void> >
164 class simple_seq_fit;
166 template<class MutexFamily, class VoidMutex = offset_ptr<void>, std::size_t MemAlignment = 0>
167 class rbtree_best_fit;
169 //////////////////////////////////////////////////////////////////////////////
170 // Index Types
171 //////////////////////////////////////////////////////////////////////////////
173 template<class IndexConfig> class flat_map_index;
174 template<class IndexConfig> class iset_index;
175 template<class IndexConfig> class iunordered_set_index;
176 template<class IndexConfig> class map_index;
177 template<class IndexConfig> class null_index;
178 template<class IndexConfig> class unordered_map_index;
180 //////////////////////////////////////////////////////////////////////////////
181 // Segment manager
182 //////////////////////////////////////////////////////////////////////////////
184 template <class CharType
185 ,class MemoryAlgorithm
186 ,template<class IndexConfig> class IndexType>
187 class segment_manager;
189 //////////////////////////////////////////////////////////////////////////////
190 // External buffer managed memory classes
191 //////////////////////////////////////////////////////////////////////////////
193 template <class CharType
194 ,class MemoryAlgorithm
195 ,template<class IndexConfig> class IndexType>
196 class basic_managed_external_buffer;
198 typedef basic_managed_external_buffer
199 <char
200 ,rbtree_best_fit<null_mutex_family>
201 ,iset_index>
202 managed_external_buffer;
204 typedef basic_managed_external_buffer
205 <wchar_t
206 ,rbtree_best_fit<null_mutex_family>
207 ,iset_index>
208 wmanaged_external_buffer;
210 //////////////////////////////////////////////////////////////////////////////
211 // managed memory classes
212 //////////////////////////////////////////////////////////////////////////////
214 template <class CharType
215 ,class MemoryAlgorithm
216 ,template<class IndexConfig> class IndexType>
217 class basic_managed_shared_memory;
219 typedef basic_managed_shared_memory
220 <char
221 ,rbtree_best_fit<mutex_family>
222 ,iset_index>
223 managed_shared_memory;
225 typedef basic_managed_shared_memory
226 <wchar_t
227 ,rbtree_best_fit<mutex_family>
228 ,iset_index>
229 wmanaged_shared_memory;
232 //////////////////////////////////////////////////////////////////////////////
233 // Windows shared memory managed memory classes
234 //////////////////////////////////////////////////////////////////////////////
236 #if defined (BOOST_INTERPROCESS_WINDOWS)
238 template <class CharType
239 ,class MemoryAlgorithm
240 ,template<class IndexConfig> class IndexType>
241 class basic_managed_windows_shared_memory;
243 typedef basic_managed_windows_shared_memory
244 <char
245 ,rbtree_best_fit<mutex_family>
246 ,iset_index>
247 managed_windows_shared_memory;
249 typedef basic_managed_windows_shared_memory
250 <wchar_t
251 ,rbtree_best_fit<mutex_family>
252 ,iset_index>
253 wmanaged_windows_shared_memory;
255 #else
257 template <class CharType
258 ,class MemoryAlgorithm
259 ,template<class IndexConfig> class IndexType>
260 class basic_managed_xsi_shared_memory;
262 typedef basic_managed_xsi_shared_memory
263 <char
264 ,rbtree_best_fit<mutex_family>
265 ,iset_index>
266 managed_xsi_shared_memory;
268 typedef basic_managed_xsi_shared_memory
269 <wchar_t
270 ,rbtree_best_fit<mutex_family>
271 ,iset_index>
272 wmanaged_xsi_shared_memory;
274 #endif //#if defined (BOOST_INTERPROCESS_WINDOWS)
276 //////////////////////////////////////////////////////////////////////////////
277 // Fixed address shared memory
278 //////////////////////////////////////////////////////////////////////////////
280 typedef basic_managed_shared_memory
281 <char
282 ,rbtree_best_fit<mutex_family, void*>
283 ,iset_index>
284 fixed_managed_shared_memory;
286 typedef basic_managed_shared_memory
287 <wchar_t
288 ,rbtree_best_fit<mutex_family, void*>
289 ,iset_index>
290 wfixed_managed_shared_memory;
292 //////////////////////////////////////////////////////////////////////////////
293 // Heap memory managed memory classes
294 //////////////////////////////////////////////////////////////////////////////
296 template
297 <class CharType
298 ,class MemoryAlgorithm
299 ,template<class IndexConfig> class IndexType>
300 class basic_managed_heap_memory;
302 typedef basic_managed_heap_memory
303 <char
304 ,rbtree_best_fit<null_mutex_family>
305 ,iset_index>
306 managed_heap_memory;
308 typedef basic_managed_heap_memory
309 <wchar_t
310 ,rbtree_best_fit<null_mutex_family>
311 ,iset_index>
312 wmanaged_heap_memory;
314 //////////////////////////////////////////////////////////////////////////////
315 // Mapped file managed memory classes
316 //////////////////////////////////////////////////////////////////////////////
318 template
319 <class CharType
320 ,class MemoryAlgorithm
321 ,template<class IndexConfig> class IndexType>
322 class basic_managed_mapped_file;
324 typedef basic_managed_mapped_file
325 <char
326 ,rbtree_best_fit<mutex_family>
327 ,iset_index>
328 managed_mapped_file;
330 typedef basic_managed_mapped_file
331 <wchar_t
332 ,rbtree_best_fit<mutex_family>
333 ,iset_index>
334 wmanaged_mapped_file;
336 //////////////////////////////////////////////////////////////////////////////
337 // Exceptions
338 //////////////////////////////////////////////////////////////////////////////
340 class interprocess_exception;
341 class lock_exception;
342 class bad_alloc;
344 //////////////////////////////////////////////////////////////////////////////
345 // Bufferstream
346 //////////////////////////////////////////////////////////////////////////////
348 //bufferstream
349 template <class CharT
350 ,class CharTraits = std::char_traits<CharT> >
351 class basic_bufferbuf;
353 template <class CharT
354 ,class CharTraits = std::char_traits<CharT> >
355 class basic_ibufferstream;
357 template <class CharT
358 ,class CharTraits = std::char_traits<CharT> >
359 class basic_obufferstream;
361 template <class CharT
362 ,class CharTraits = std::char_traits<CharT> >
363 class basic_bufferstream;
365 //////////////////////////////////////////////////////////////////////////////
366 // Vectorstream
367 //////////////////////////////////////////////////////////////////////////////
369 template <class CharVector
370 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
371 class basic_vectorbuf;
373 template <class CharVector
374 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
375 class basic_ivectorstream;
377 template <class CharVector
378 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
379 class basic_ovectorstream;
381 template <class CharVector
382 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
383 class basic_vectorstream;
385 //////////////////////////////////////////////////////////////////////////////
386 // Smart pointers
387 //////////////////////////////////////////////////////////////////////////////
389 template<class T, class Deleter>
390 class scoped_ptr;
392 template<class T, class VoidPointer>
393 class intrusive_ptr;
395 template<class T, class VoidAllocator, class Deleter>
396 class shared_ptr;
398 template<class T, class VoidAllocator, class Deleter>
399 class weak_ptr;
401 //////////////////////////////////////////////////////////////////////////////
402 // IPC
403 //////////////////////////////////////////////////////////////////////////////
405 class message_queue;
407 }} //namespace boost { namespace interprocess {
409 //////////////////////////////////////////////////////////////////////////////
410 // CONTAINERS
411 //////////////////////////////////////////////////////////////////////////////
413 #include <boost/interprocess/detail/config_end.hpp>
415 #endif //#ifndef BOOST_INTERPROCESS_FWD_HPP