Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:44:11

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