Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-16 08:09:05

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2005-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_FWD_HPP
0012 #define BOOST_INTERPROCESS_FWD_HPP
0013 
0014 #ifndef BOOST_CONFIG_HPP
0015 #  include <boost/config.hpp>
0016 #endif
0017 #ifndef BOOST_CSTDINT_HPP
0018 #  include <boost/cstdint.hpp>
0019 #endif
0020 0021 ">#
0022 #if defined(BOOST_HAS_PRAGMA_ONCE)
0023 #  pragma once
0024 #endif
0025 
0026 #include <boost/interprocess/detail/std_fwd.hpp>
0027 
0028 //! \file
0029 //! This header file forward declares the basic interprocess types:
0030 //!   - boost::interprocess::offset_ptr;
0031 //!   - boost::interprocess::permissions;
0032 //!   - boost::interprocess::mapped_region;
0033 //!   - boost::interprocess::file_mapping;
0034 //!   - boost::interprocess::shared_memory_object;
0035 //!   - boost::interprocess::windows_shared_memory;
0036 //!   - boost::interprocess::xsi_shared_memory;
0037 //!
0038 //! The following synchronization mechanisms and locks:
0039 //!   - boost::interprocess::null_mutex;
0040 //!   - boost::interprocess::interprocess_mutex;
0041 //!   - boost::interprocess::interprocess_recursive_mutex;
0042 //!   - boost::interprocess::interprocess_semaphore;
0043 //!   - boost::interprocess::named_mutex;
0044 //!   - boost::interprocess::named_recursive_mutex;
0045 //!   - boost::interprocess::named_semaphore;
0046 //!   - boost::interprocess::interprocess_sharable_mutex;
0047 //!   - boost::interprocess::interprocess_condition;
0048 //!   - boost::interprocess::scoped_lock;
0049 //!   - boost::interprocess::sharable_lock;
0050 //!   - boost::interprocess::upgradable_lock;
0051 //!
0052 //! The following mutex families:
0053 //!   - boost::interprocess::mutex_family;
0054 //!   - boost::interprocess::null_mutex_family;
0055 //!
0056 //! The following allocators:
0057 //!   - boost::interprocess::allocator;
0058 //!   - boost::interprocess::node_allocator;
0059 //!   - boost::interprocess::private_node_allocator;
0060 //!   - boost::interprocess::cached_node_allocator;
0061 //!   - boost::interprocess::adaptive_pool;
0062 //!   - boost::interprocess::private_adaptive_pool;
0063 //!   - boost::interprocess::cached_adaptive_pool;
0064 //!
0065 //! The following allocation algorithms:
0066 //!   - boost::interprocess::simple_seq_fit;
0067 //!   - boost::interprocess::rbtree_best_fit;
0068 //!
0069 //! The following index types:
0070 //!   - boost::interprocess::flat_map_index;
0071 //!   - boost::interprocess::iset_index;
0072 //!   - boost::interprocess::iunordered_set_index;
0073 //!   - boost::interprocess::map_index;
0074 //!   - boost::interprocess::null_index;
0075 //!   - boost::interprocess::unordered_map_index;
0076 //!
0077 //! The following managed memory types:
0078 //!   - boost::interprocess::segment_manager;
0079 //!   - boost::interprocess::basic_managed_external_buffer
0080 //!   - boost::interprocess::managed_external_buffer
0081 //!   - boost::interprocess::wmanaged_external_buffer
0082 //!   - boost::interprocess::basic_managed_shared_memory
0083 //!   - boost::interprocess::managed_shared_memory
0084 //!   - boost::interprocess::wmanaged_shared_memory
0085 //!   - boost::interprocess::basic_managed_windows_shared_memory
0086 //!   - boost::interprocess::managed_windows_shared_memory
0087 //!   - boost::interprocess::wmanaged_windows_shared_memory
0088 //!   - boost::interprocess::basic_managed_xsi_shared_memory
0089 //!   - boost::interprocess::managed_xsi_shared_memory
0090 //!   - boost::interprocess::wmanaged_xsi_shared_memory
0091 //!   - boost::interprocess::fixed_managed_shared_memory
0092 //!   - boost::interprocess::wfixed_managed_shared_memory
0093 //!   - boost::interprocess::basic_managed_heap_memory
0094 //!   - boost::interprocess::managed_heap_memory
0095 //!   - boost::interprocess::wmanaged_heap_memory
0096 //!   - boost::interprocess::basic_managed_mapped_file
0097 //!   - boost::interprocess::managed_mapped_file
0098 //!   - boost::interprocess::wmanaged_mapped_file
0099 //!
0100 //! The following exception types:
0101 //!   - boost::interprocess::interprocess_exception
0102 //!   - boost::interprocess::lock_exception
0103 //!   - boost::interprocess::bad_alloc
0104 //!
0105 //! The following stream types:
0106 //!   - boost::interprocess::basic_bufferbuf
0107 //!   - boost::interprocess::basic_ibufferstream
0108 //!   - boost::interprocess::basic_obufferstream
0109 //!   - boost::interprocess::basic_bufferstream
0110 //!   - boost::interprocess::basic_vectorbuf
0111 //!   - boost::interprocess::basic_ivectorstream
0112 //!   - boost::interprocess::basic_ovectorstream
0113 //!   - boost::interprocess::basic_vectorstream
0114 //!
0115 //! The following smart pointer types:
0116 //!   - boost::interprocess::scoped_ptr
0117 //!   - boost::interprocess::intrusive_ptr
0118 //!   - boost::interprocess::shared_ptr
0119 //!   - boost::interprocess::weak_ptr
0120 //!
0121 //! The following interprocess communication types:
0122 //!   - boost::interprocess::message_queue_t;
0123 //!   - boost::interprocess::message_queue;
0124 
0125 #include <boost/interprocess/detail/config_begin.hpp>
0126 #include <boost/interprocess/detail/workaround.hpp>
0127 
0128 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0129 
0130 #include <cstddef>
0131 
0132 //////////////////////////////////////////////////////////////////////////////
0133 //                        Standard predeclarations
0134 //////////////////////////////////////////////////////////////////////////////
0135 
0136 namespace boost{  namespace intrusive{ }  }
0137 namespace boost{  namespace interprocess{ namespace bi = boost::intrusive; }  }
0138 
0139 namespace boost { namespace interprocess {
0140 
0141 //////////////////////////////////////////////////////////////////////////////
0142 //                            permissions
0143 //////////////////////////////////////////////////////////////////////////////
0144 
0145 class permissions;
0146 
0147 //////////////////////////////////////////////////////////////////////////////
0148 //                            shared_memory
0149 //////////////////////////////////////////////////////////////////////////////
0150 
0151 class shared_memory_object;
0152 
0153 #if defined (BOOST_INTERPROCESS_WINDOWS)
0154 class windows_shared_memory;
0155 #endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
0156 
0157 #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
0158 class xsi_shared_memory;
0159 #endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
0160 
0161 //////////////////////////////////////////////////////////////////////////////
0162 //              file mapping / mapped region
0163 //////////////////////////////////////////////////////////////////////////////
0164 
0165 class file_mapping;
0166 class mapped_region;
0167 
0168 //////////////////////////////////////////////////////////////////////////////
0169 //                               Mutexes
0170 //////////////////////////////////////////////////////////////////////////////
0171 
0172 class null_mutex;
0173 
0174 class interprocess_mutex;
0175 class interprocess_recursive_mutex;
0176 
0177 class named_mutex;
0178 class named_recursive_mutex;
0179 
0180 class interprocess_semaphore;
0181 class named_semaphore;
0182 
0183 //////////////////////////////////////////////////////////////////////////////
0184 //                         Mutex families
0185 //////////////////////////////////////////////////////////////////////////////
0186 
0187 struct mutex_family;
0188 struct null_mutex_family;
0189 
0190 //////////////////////////////////////////////////////////////////////////////
0191 //                   Other synchronization classes
0192 //////////////////////////////////////////////////////////////////////////////
0193 
0194 class interprocess_sharable_mutex;
0195 class interprocess_condition;
0196 
0197 //////////////////////////////////////////////////////////////////////////////
0198 //                              Locks
0199 //////////////////////////////////////////////////////////////////////////////
0200 
0201 template <class Mutex>
0202 class scoped_lock;
0203 
0204 template <class SharableMutex>
0205 class sharable_lock;
0206 
0207 template <class UpgradableMutex>
0208 class upgradable_lock;
0209 
0210 //////////////////////////////////////////////////////////////////////////////
0211 //                      STL compatible allocators
0212 //////////////////////////////////////////////////////////////////////////////
0213 
0214 template<class T, class SegmentManager>
0215 class allocator;
0216 
0217 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
0218 class node_allocator;
0219 
0220 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
0221 class private_node_allocator;
0222 
0223 template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
0224 class cached_node_allocator;
0225 
0226 template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
0227         , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
0228 class adaptive_pool;
0229 
0230 template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
0231         , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
0232 class private_adaptive_pool;
0233 
0234 template< class T, class SegmentManager, std::size_t NodesPerBlock = 64
0235         , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 >
0236 class cached_adaptive_pool;
0237 
0238 
0239 //////////////////////////////////////////////////////////////////////////////
0240 //                            offset_ptr
0241 //////////////////////////////////////////////////////////////////////////////
0242 
0243 static const std::size_t offset_type_alignment = 0;
0244 
0245 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0246 #  ifdef BOOST_HAS_INTPTR_T
0247       using ::boost::uintptr_t;
0248 #  else
0249       typedef std::size_t uintptr_t;
0250 #  endif
0251 #endif
0252 
0253 template < class T, class DifferenceType = std::ptrdiff_t
0254          , class OffsetType = uintptr_t, std::size_t Alignment = offset_type_alignment>
0255 class offset_ptr;
0256 
0257 //////////////////////////////////////////////////////////////////////////////
0258 //                    Memory allocation algorithms
0259 //////////////////////////////////////////////////////////////////////////////
0260 
0261 //Single segment memory allocation algorithms
0262 template<class MutexFamily, class VoidMutex = offset_ptr<void> >
0263 class simple_seq_fit;
0264 
0265 template<class MutexFamily, class VoidMutex = offset_ptr<void>, std::size_t MemAlignment = 0>
0266 class rbtree_best_fit;
0267 
0268 //////////////////////////////////////////////////////////////////////////////
0269 //                         Index Types
0270 //////////////////////////////////////////////////////////////////////////////
0271 
0272 template<class IndexConfig> class flat_map_index;
0273 template<class IndexConfig> class iset_index;
0274 template<class IndexConfig> class iunordered_set_index;
0275 template<class IndexConfig> class map_index;
0276 template<class IndexConfig> class null_index;
0277 template<class IndexConfig> class unordered_map_index;
0278 
0279 //////////////////////////////////////////////////////////////////////////////
0280 //                         Segment manager
0281 //////////////////////////////////////////////////////////////////////////////
0282 
0283 template <class CharType
0284          ,class MemoryAlgorithm
0285          ,template<class IndexConfig> class IndexType>
0286 class segment_manager;
0287 
0288 //////////////////////////////////////////////////////////////////////////////
0289 //                  External buffer managed memory classes
0290 //////////////////////////////////////////////////////////////////////////////
0291 
0292 template <class CharType
0293          ,class MemoryAlgorithm
0294          ,template<class IndexConfig> class IndexType>
0295 class basic_managed_external_buffer;
0296 
0297 typedef basic_managed_external_buffer
0298    <char
0299    ,rbtree_best_fit<null_mutex_family>
0300    ,iset_index>
0301 managed_external_buffer;
0302 
0303 typedef basic_managed_external_buffer
0304    <wchar_t
0305    ,rbtree_best_fit<null_mutex_family>
0306    ,iset_index>
0307 wmanaged_external_buffer;
0308 
0309 //////////////////////////////////////////////////////////////////////////////
0310 //                      managed memory classes
0311 //////////////////////////////////////////////////////////////////////////////
0312 
0313 template <class CharType
0314          ,class MemoryAlgorithm
0315          ,template<class IndexConfig> class IndexType>
0316 class basic_managed_shared_memory;
0317 
0318 typedef basic_managed_shared_memory
0319    <char
0320    ,rbtree_best_fit<mutex_family>
0321    ,iset_index>
0322 managed_shared_memory;
0323 
0324 typedef basic_managed_shared_memory
0325    <wchar_t
0326    ,rbtree_best_fit<mutex_family>
0327    ,iset_index>
0328 wmanaged_shared_memory;
0329 
0330 
0331 //////////////////////////////////////////////////////////////////////////////
0332 //                      Windows shared memory managed memory classes
0333 //////////////////////////////////////////////////////////////////////////////
0334 
0335 #if defined (BOOST_INTERPROCESS_WINDOWS)
0336 
0337 template <class CharType
0338          ,class MemoryAlgorithm
0339          ,template<class IndexConfig> class IndexType>
0340 class basic_managed_windows_shared_memory;
0341 
0342 typedef basic_managed_windows_shared_memory
0343    <char
0344    ,rbtree_best_fit<mutex_family>
0345    ,iset_index>
0346 managed_windows_shared_memory;
0347 
0348 typedef basic_managed_windows_shared_memory
0349    <wchar_t
0350    ,rbtree_best_fit<mutex_family>
0351    ,iset_index>
0352 wmanaged_windows_shared_memory;
0353 
0354 #endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
0355 
0356 #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
0357 
0358 template <class CharType
0359          ,class MemoryAlgorithm
0360          ,template<class IndexConfig> class IndexType>
0361 class basic_managed_xsi_shared_memory;
0362 
0363 typedef basic_managed_xsi_shared_memory
0364    <char
0365    ,rbtree_best_fit<mutex_family>
0366    ,iset_index>
0367 managed_xsi_shared_memory;
0368 
0369 typedef basic_managed_xsi_shared_memory
0370    <wchar_t
0371    ,rbtree_best_fit<mutex_family>
0372    ,iset_index>
0373 wmanaged_xsi_shared_memory;
0374 
0375 #endif //#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
0376 
0377 //////////////////////////////////////////////////////////////////////////////
0378 //                      Fixed address shared memory
0379 //////////////////////////////////////////////////////////////////////////////
0380 
0381 typedef basic_managed_shared_memory
0382    <char
0383    ,rbtree_best_fit<mutex_family, void*>
0384    ,iset_index>
0385 fixed_managed_shared_memory;
0386 
0387 typedef basic_managed_shared_memory
0388    <wchar_t
0389    ,rbtree_best_fit<mutex_family, void*>
0390    ,iset_index>
0391 wfixed_managed_shared_memory;
0392 
0393 //////////////////////////////////////////////////////////////////////////////
0394 //                      Heap memory managed memory classes
0395 //////////////////////////////////////////////////////////////////////////////
0396 
0397 template
0398    <class CharType
0399    ,class MemoryAlgorithm
0400    ,template<class IndexConfig> class IndexType>
0401 class basic_managed_heap_memory;
0402 
0403 typedef basic_managed_heap_memory
0404    <char
0405    ,rbtree_best_fit<null_mutex_family>
0406    ,iset_index>
0407 managed_heap_memory;
0408 
0409 typedef basic_managed_heap_memory
0410    <wchar_t
0411    ,rbtree_best_fit<null_mutex_family>
0412    ,iset_index>
0413 wmanaged_heap_memory;
0414 
0415 //////////////////////////////////////////////////////////////////////////////
0416 //                         Mapped file managed memory classes
0417 //////////////////////////////////////////////////////////////////////////////
0418 
0419 template
0420    <class CharType
0421    ,class MemoryAlgorithm
0422    ,template<class IndexConfig> class IndexType>
0423 class basic_managed_mapped_file;
0424 
0425 typedef basic_managed_mapped_file
0426    <char
0427    ,rbtree_best_fit<mutex_family>
0428    ,iset_index>
0429 managed_mapped_file;
0430 
0431 typedef basic_managed_mapped_file
0432    <wchar_t
0433    ,rbtree_best_fit<mutex_family>
0434    ,iset_index>
0435 wmanaged_mapped_file;
0436 
0437 //////////////////////////////////////////////////////////////////////////////
0438 //                            Exceptions
0439 //////////////////////////////////////////////////////////////////////////////
0440 
0441 class interprocess_exception;
0442 class lock_exception;
0443 class bad_alloc;
0444 
0445 //////////////////////////////////////////////////////////////////////////////
0446 //                            Bufferstream
0447 //////////////////////////////////////////////////////////////////////////////
0448 
0449 //bufferstream
0450 template <class CharT
0451          ,class CharTraits = std::char_traits<CharT> >
0452 class basic_bufferbuf;
0453 
0454 template <class CharT
0455          ,class CharTraits = std::char_traits<CharT> >
0456 class basic_ibufferstream;
0457 
0458 template <class CharT
0459          ,class CharTraits = std::char_traits<CharT> >
0460 class basic_obufferstream;
0461 
0462 template <class CharT
0463          ,class CharTraits = std::char_traits<CharT> >
0464 class basic_bufferstream;
0465 
0466 //////////////////////////////////////////////////////////////////////////////
0467 //                            Vectorstream
0468 //////////////////////////////////////////////////////////////////////////////
0469 
0470 template <class CharVector
0471          ,class CharTraits = std::char_traits<typename CharVector::value_type> >
0472 class basic_vectorbuf;
0473 
0474 template <class CharVector
0475          ,class CharTraits = std::char_traits<typename CharVector::value_type> >
0476 class basic_ivectorstream;
0477 
0478 template <class CharVector
0479          ,class CharTraits = std::char_traits<typename CharVector::value_type> >
0480 class basic_ovectorstream;
0481 
0482 template <class CharVector
0483          ,class CharTraits = std::char_traits<typename CharVector::value_type> >
0484 class basic_vectorstream;
0485 
0486 //////////////////////////////////////////////////////////////////////////////
0487 //                             Smart pointers
0488 //////////////////////////////////////////////////////////////////////////////
0489 
0490 template<class T, class Deleter>
0491 class scoped_ptr;
0492 
0493 template<class T, class VoidPointer>
0494 class intrusive_ptr;
0495 
0496 template<class T, class VoidAllocator, class Deleter>
0497 class shared_ptr;
0498 
0499 template<class T, class VoidAllocator, class Deleter>
0500 class weak_ptr;
0501 
0502 //////////////////////////////////////////////////////////////////////////////
0503 //                                  IPC
0504 //////////////////////////////////////////////////////////////////////////////
0505 
0506 template<class VoidPointer>
0507 class message_queue_t;
0508 
0509 typedef message_queue_t<offset_ptr<void> > message_queue;
0510 
0511 }}  //namespace boost { namespace interprocess {
0512 
0513 #endif   //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0514 
0515 #include <boost/interprocess/detail/config_end.hpp>
0516 
0517 #endif //#ifndef BOOST_INTERPROCESS_FWD_HPP