1//////////////////////////////////////////////////////////////////////////////
2//
3// (C) Copyright Ion Gaztanaga 2005-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)
6//
7// See http://www.boost.org/libs/interprocess for documentation.
8//
9//////////////////////////////////////////////////////////////////////////////
10
11#ifndef BOOST_INTERPROCESS_FWD_HPP
12#define BOOST_INTERPROCESS_FWD_HPP
13
14#ifndef BOOST_CONFIG_HPP
15# include <boost/config.hpp>
16#endif
17#ifndef BOOST_CSTDINT_HPP
18# include <boost/cstdint.hpp>
19#endif
20#
21#if defined(BOOST_HAS_PRAGMA_ONCE)
22# pragma once
23#endif
24
25#include <boost/interprocess/detail/std_fwd.hpp>
26
27//! \file
28//! This header file forward declares the basic interprocess types:
29//! - boost::interprocess::offset_ptr;
30//! - boost::interprocess::permissions;
31//! - boost::interprocess::mapped_region;
32//! - boost::interprocess::file_mapping;
33//! - boost::interprocess::shared_memory_object;
34//! - boost::interprocess::windows_shared_memory;
35//! - boost::interprocess::xsi_shared_memory;
36//!
37//! The following synchronization mechanisms and locks:
38//! - boost::interprocess::null_mutex;
39//! - boost::interprocess::interprocess_mutex;
40//! - boost::interprocess::interprocess_recursive_mutex;
41//! - boost::interprocess::interprocess_semaphore;
42//! - boost::interprocess::named_mutex;
43//! - boost::interprocess::named_recursive_mutex;
44//! - boost::interprocess::named_semaphore;
45//! - boost::interprocess::interprocess_sharable_mutex;
46//! - boost::interprocess::interprocess_condition;
47//! - boost::interprocess::scoped_lock;
48//! - boost::interprocess::sharable_lock;
49//! - boost::interprocess::upgradable_lock;
50//!
51//! The following mutex families:
52//! - boost::interprocess::mutex_family;
53//! - boost::interprocess::null_mutex_family;
54//!
55//! The following allocators:
56//! - boost::interprocess::allocator;
57//! - boost::interprocess::node_allocator;
58//! - boost::interprocess::private_node_allocator;
59//! - boost::interprocess::cached_node_allocator;
60//! - boost::interprocess::adaptive_pool;
61//! - boost::interprocess::private_adaptive_pool;
62//! - boost::interprocess::cached_adaptive_pool;
63//!
64//! The following allocation algorithms:
65//! - boost::interprocess::simple_seq_fit;
66//! - boost::interprocess::rbtree_best_fit;
67//!
68//! The following index types:
69//! - boost::interprocess::flat_map_index;
70//! - boost::interprocess::iset_index;
71//! - boost::interprocess::iunordered_set_index;
72//! - boost::interprocess::map_index;
73//! - boost::interprocess::null_index;
74//! - boost::interprocess::unordered_map_index;
75//!
76//! The following managed memory types:
77//! - boost::interprocess::segment_manager;
78//! - boost::interprocess::basic_managed_external_buffer
79//! - boost::interprocess::managed_external_buffer
80//! - boost::interprocess::wmanaged_external_buffer
81//! - boost::interprocess::basic_managed_shared_memory
82//! - boost::interprocess::managed_shared_memory
83//! - boost::interprocess::wmanaged_shared_memory
84//! - boost::interprocess::basic_managed_windows_shared_memory
85//! - boost::interprocess::managed_windows_shared_memory
86//! - boost::interprocess::wmanaged_windows_shared_memory
87//! - boost::interprocess::basic_managed_xsi_shared_memory
88//! - boost::interprocess::managed_xsi_shared_memory
89//! - boost::interprocess::wmanaged_xsi_shared_memory
90//! - boost::interprocess::fixed_managed_shared_memory
91//! - boost::interprocess::wfixed_managed_shared_memory
92//! - boost::interprocess::basic_managed_heap_memory
93//! - boost::interprocess::managed_heap_memory
94//! - boost::interprocess::wmanaged_heap_memory
95//! - boost::interprocess::basic_managed_mapped_file
96//! - boost::interprocess::managed_mapped_file
97//! - boost::interprocess::wmanaged_mapped_file
98//!
99//! The following exception types:
100//! - boost::interprocess::interprocess_exception
101//! - boost::interprocess::lock_exception
102//! - boost::interprocess::bad_alloc
103//!
104//! The following stream types:
105//! - boost::interprocess::basic_bufferbuf
106//! - boost::interprocess::basic_ibufferstream
107//! - boost::interprocess::basic_obufferstream
108//! - boost::interprocess::basic_bufferstream
109//! - boost::interprocess::basic_vectorbuf
110//! - boost::interprocess::basic_ivectorstream
111//! - boost::interprocess::basic_ovectorstream
112//! - boost::interprocess::basic_vectorstream
113//!
114//! The following smart pointer types:
115//! - boost::interprocess::scoped_ptr
116//! - boost::interprocess::intrusive_ptr
117//! - boost::interprocess::shared_ptr
118//! - boost::interprocess::weak_ptr
119//!
120//! The following interprocess communication types:
121//! - boost::interprocess::message_queue_t;
122//! - boost::interprocess::message_queue;
123
124#include <boost/interprocess/detail/config_begin.hpp>
125#include <boost/interprocess/detail/workaround.hpp>
126
127#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
128
129#include <cstddef>
130
131//////////////////////////////////////////////////////////////////////////////
132// Standard predeclarations
133//////////////////////////////////////////////////////////////////////////////
134
135namespace boost{ namespace intrusive{ } }
136namespace boost{ namespace interprocess{ namespace bi = boost::intrusive; } }
137
138namespace boost { namespace interprocess {
139
140//////////////////////////////////////////////////////////////////////////////
141// permissions
142//////////////////////////////////////////////////////////////////////////////
143
144class permissions;
145
146//////////////////////////////////////////////////////////////////////////////
147// shared_memory
148//////////////////////////////////////////////////////////////////////////////
149
150class shared_memory_object;
151
152#if defined (BOOST_INTERPROCESS_WINDOWS)
153class windows_shared_memory;
154#endif //#if defined (BOOST_INTERPROCESS_WINDOWS)
155
156#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
157class xsi_shared_memory;
158#endif //#if defined (BOOST_INTERPROCESS_WINDOWS)
159
160//////////////////////////////////////////////////////////////////////////////
161// file mapping / mapped region
162//////////////////////////////////////////////////////////////////////////////
163
164class file_mapping;
165class mapped_region;
166
167//////////////////////////////////////////////////////////////////////////////
168// Mutexes
169//////////////////////////////////////////////////////////////////////////////
170
171class null_mutex;
172
173class interprocess_mutex;
174class interprocess_recursive_mutex;
175
176class named_mutex;
177class named_recursive_mutex;
178
179class interprocess_semaphore;
180class named_semaphore;
181
182//////////////////////////////////////////////////////////////////////////////
183// Mutex families
184//////////////////////////////////////////////////////////////////////////////
185
186struct mutex_family;
187struct null_mutex_family;
188
189//////////////////////////////////////////////////////////////////////////////
190// Other synchronization classes
191//////////////////////////////////////////////////////////////////////////////
192
193class interprocess_sharable_mutex;
194class interprocess_condition;
195
196//////////////////////////////////////////////////////////////////////////////
197// Locks
198//////////////////////////////////////////////////////////////////////////////
199
200template <class Mutex>
201class scoped_lock;
202
203template <class SharableMutex>
204class sharable_lock;
205
206template <class UpgradableMutex>
207class upgradable_lock;
208
209//////////////////////////////////////////////////////////////////////////////
210// STL compatible allocators
211//////////////////////////////////////////////////////////////////////////////
212
213template<class T, class SegmentManager>
214class allocator;
215
216template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
217class node_allocator;
218
219template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
220class private_node_allocator;
221
222template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
223class cached_node_allocator;
224
225template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
226 , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
227class adaptive_pool;
228
229template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
230 , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
231class private_adaptive_pool;
232
233template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
234 , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
235class cached_adaptive_pool;
236
237
238//////////////////////////////////////////////////////////////////////////////
239// offset_ptr
240//////////////////////////////////////////////////////////////////////////////
241
242static const std::size_t offset_type_alignment = 0;
243
244#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
245# ifdef BOOST_HAS_INTPTR_T
246 using ::boost::uintptr_t;
247# else
248 typedef std::size_t uintptr_t;
249# endif
250#endif
251
252template < class T, class DifferenceType = std::ptrdiff_t
253 , class OffsetType = uintptr_t, std::size_t Alignment = offset_type_alignment>
254class offset_ptr;
255
256//////////////////////////////////////////////////////////////////////////////
257// Memory allocation algorithms
258//////////////////////////////////////////////////////////////////////////////
259
260//Single segment memory allocation algorithms
261template<class MutexFamily, class VoidMutex = offset_ptr<void> >
262class simple_seq_fit;
263
264template<class MutexFamily, class VoidMutex = offset_ptr<void>, std::size_t MemAlignment = 0>
265class rbtree_best_fit;
266
267//////////////////////////////////////////////////////////////////////////////
268// Index Types
269//////////////////////////////////////////////////////////////////////////////
270
271template<class IndexConfig> class flat_map_index;
272template<class IndexConfig> class iset_index;
273template<class IndexConfig> class iunordered_set_index;
274template<class IndexConfig> class map_index;
275template<class IndexConfig> class null_index;
276template<class IndexConfig> class unordered_map_index;
277
278//////////////////////////////////////////////////////////////////////////////
279// Segment manager
280//////////////////////////////////////////////////////////////////////////////
281
282template <class CharType
283 ,class MemoryAlgorithm
284 ,template<class IndexConfig> class IndexType>
285class segment_manager;
286
287//////////////////////////////////////////////////////////////////////////////
288// External buffer managed memory classes
289//////////////////////////////////////////////////////////////////////////////
290
291template <class CharType
292 ,class MemoryAlgorithm
293 ,template<class IndexConfig> class IndexType>
294class basic_managed_external_buffer;
295
296typedef basic_managed_external_buffer
297 <char
298 ,rbtree_best_fit<null_mutex_family>
299 ,iset_index>
300managed_external_buffer;
301
302typedef basic_managed_external_buffer
303 <wchar_t
304 ,rbtree_best_fit<null_mutex_family>
305 ,iset_index>
306wmanaged_external_buffer;
307
308//////////////////////////////////////////////////////////////////////////////
309// managed memory classes
310//////////////////////////////////////////////////////////////////////////////
311
312template <class CharType
313 ,class MemoryAlgorithm
314 ,template<class IndexConfig> class IndexType>
315class basic_managed_shared_memory;
316
317typedef basic_managed_shared_memory
318 <char
319 ,rbtree_best_fit<mutex_family>
320 ,iset_index>
321managed_shared_memory;
322
323typedef basic_managed_shared_memory
324 <wchar_t
325 ,rbtree_best_fit<mutex_family>
326 ,iset_index>
327wmanaged_shared_memory;
328
329
330//////////////////////////////////////////////////////////////////////////////
331// Windows shared memory managed memory classes
332//////////////////////////////////////////////////////////////////////////////
333
334#if defined (BOOST_INTERPROCESS_WINDOWS)
335
336template <class CharType
337 ,class MemoryAlgorithm
338 ,template<class IndexConfig> class IndexType>
339class basic_managed_windows_shared_memory;
340
341typedef basic_managed_windows_shared_memory
342 <char
343 ,rbtree_best_fit<mutex_family>
344 ,iset_index>
345managed_windows_shared_memory;
346
347typedef basic_managed_windows_shared_memory
348 <wchar_t
349 ,rbtree_best_fit<mutex_family>
350 ,iset_index>
351wmanaged_windows_shared_memory;
352
353#endif //#if defined (BOOST_INTERPROCESS_WINDOWS)
354
355#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
356
357template <class CharType
358 ,class MemoryAlgorithm
359 ,template<class IndexConfig> class IndexType>
360class basic_managed_xsi_shared_memory;
361
362typedef basic_managed_xsi_shared_memory
363 <char
364 ,rbtree_best_fit<mutex_family>
365 ,iset_index>
366managed_xsi_shared_memory;
367
368typedef basic_managed_xsi_shared_memory
369 <wchar_t
370 ,rbtree_best_fit<mutex_family>
371 ,iset_index>
372wmanaged_xsi_shared_memory;
373
374#endif //#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
375
376//////////////////////////////////////////////////////////////////////////////
377// Fixed address shared memory
378//////////////////////////////////////////////////////////////////////////////
379
380typedef basic_managed_shared_memory
381 <char
382 ,rbtree_best_fit<mutex_family, void*>
383 ,iset_index>
384fixed_managed_shared_memory;
385
386typedef basic_managed_shared_memory
387 <wchar_t
388 ,rbtree_best_fit<mutex_family, void*>
389 ,iset_index>
390wfixed_managed_shared_memory;
391
392//////////////////////////////////////////////////////////////////////////////
393// Heap memory managed memory classes
394//////////////////////////////////////////////////////////////////////////////
395
396template
397 <class CharType
398 ,class MemoryAlgorithm
399 ,template<class IndexConfig> class IndexType>
400class basic_managed_heap_memory;
401
402typedef basic_managed_heap_memory
403 <char
404 ,rbtree_best_fit<null_mutex_family>
405 ,iset_index>
406managed_heap_memory;
407
408typedef basic_managed_heap_memory
409 <wchar_t
410 ,rbtree_best_fit<null_mutex_family>
411 ,iset_index>
412wmanaged_heap_memory;
413
414//////////////////////////////////////////////////////////////////////////////
415// Mapped file managed memory classes
416//////////////////////////////////////////////////////////////////////////////
417
418template
419 <class CharType
420 ,class MemoryAlgorithm
421 ,template<class IndexConfig> class IndexType>
422class basic_managed_mapped_file;
423
424typedef basic_managed_mapped_file
425 <char
426 ,rbtree_best_fit<mutex_family>
427 ,iset_index>
428managed_mapped_file;
429
430typedef basic_managed_mapped_file
431 <wchar_t
432 ,rbtree_best_fit<mutex_family>
433 ,iset_index>
434wmanaged_mapped_file;
435
436//////////////////////////////////////////////////////////////////////////////
437// Exceptions
438//////////////////////////////////////////////////////////////////////////////
439
440class interprocess_exception;
441class lock_exception;
442class bad_alloc;
443
444//////////////////////////////////////////////////////////////////////////////
445// Bufferstream
446//////////////////////////////////////////////////////////////////////////////
447
448//bufferstream
449template <class CharT
450 ,class CharTraits = std::char_traits<CharT> >
451class basic_bufferbuf;
452
453template <class CharT
454 ,class CharTraits = std::char_traits<CharT> >
455class basic_ibufferstream;
456
457template <class CharT
458 ,class CharTraits = std::char_traits<CharT> >
459class basic_obufferstream;
460
461template <class CharT
462 ,class CharTraits = std::char_traits<CharT> >
463class basic_bufferstream;
464
465//////////////////////////////////////////////////////////////////////////////
466// Vectorstream
467//////////////////////////////////////////////////////////////////////////////
468
469template <class CharVector
470 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
471class basic_vectorbuf;
472
473template <class CharVector
474 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
475class basic_ivectorstream;
476
477template <class CharVector
478 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
479class basic_ovectorstream;
480
481template <class CharVector
482 ,class CharTraits = std::char_traits<typename CharVector::value_type> >
483class basic_vectorstream;
484
485//////////////////////////////////////////////////////////////////////////////
486// Smart pointers
487//////////////////////////////////////////////////////////////////////////////
488
489template<class T, class Deleter>
490class scoped_ptr;
491
492template<class T, class VoidPointer>
493class intrusive_ptr;
494
495template<class T, class VoidAllocator, class Deleter>
496class shared_ptr;
497
498template<class T, class VoidAllocator, class Deleter>
499class weak_ptr;
500
501//////////////////////////////////////////////////////////////////////////////
502// IPC
503//////////////////////////////////////////////////////////////////////////////
504
505template<class VoidPointer>
506class message_queue_t;
507
508typedef message_queue_t<offset_ptr<void> > message_queue;
509
510}} //namespace boost { namespace interprocess {
511
512#endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
513
514#include <boost/interprocess/detail/config_end.hpp>
515
516#endif //#ifndef BOOST_INTERPROCESS_FWD_HPP
517

source code of boost/libs/interprocess/include/boost/interprocess/interprocess_fwd.hpp