Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/interprocess for documentation. Chris@16: // Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_INTERPROCESS_FWD_HPP Chris@16: #define BOOST_INTERPROCESS_FWD_HPP Chris@16: Chris@101: #ifndef BOOST_CONFIG_HPP Chris@101: # include Chris@101: #endif Chris@101: # Chris@101: #if defined(BOOST_HAS_PRAGMA_ONCE) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@101: #include Chris@101: Chris@101: //! \file Chris@101: //! This header file forward declares the basic interprocess types: Chris@101: //! - boost::interprocess::offset_ptr; Chris@101: //! - boost::interprocess::permissions; Chris@101: //! - boost::interprocess::mapped_region; Chris@101: //! - boost::interprocess::file_mapping; Chris@101: //! - boost::interprocess::shared_memory_object; Chris@101: //! - boost::interprocess::windows_shared_memory; Chris@101: //! - boost::interprocess::xsi_shared_memory; Chris@101: //! Chris@101: //! The following synchronization mechanisms and locks: Chris@101: //! - boost::interprocess::null_mutex; Chris@101: //! - boost::interprocess::interprocess_mutex; Chris@101: //! - boost::interprocess::interprocess_recursive_mutex; Chris@101: //! - boost::interprocess::interprocess_semaphore; Chris@101: //! - boost::interprocess::named_mutex; Chris@101: //! - boost::interprocess::named_recursive_mutex; Chris@101: //! - boost::interprocess::named_semaphore; Chris@101: //! - boost::interprocess::interprocess_sharable_mutex; Chris@101: //! - boost::interprocess::interprocess_condition; Chris@101: //! - boost::interprocess::scoped_lock; Chris@101: //! - boost::interprocess::sharable_lock; Chris@101: //! - boost::interprocess::upgradable_lock; Chris@101: //! Chris@101: //! The following mutex families: Chris@101: //! - boost::interprocess::mutex_family; Chris@101: //! - boost::interprocess::null_mutex_family; Chris@101: //! Chris@101: //! The following allocators: Chris@101: //! - boost::interprocess::allocator; Chris@101: //! - boost::interprocess::node_allocator; Chris@101: //! - boost::interprocess::private_node_allocator; Chris@101: //! - boost::interprocess::cached_node_allocator; Chris@101: //! - boost::interprocess::adaptive_pool; Chris@101: //! - boost::interprocess::private_adaptive_pool; Chris@101: //! - boost::interprocess::cached_adaptive_pool; Chris@101: //! Chris@101: //! The following allocation algorithms: Chris@101: //! - boost::interprocess::simple_seq_fit; Chris@101: //! - boost::interprocess::rbtree_best_fit; Chris@101: //! Chris@101: //! The following index types: Chris@101: //! - boost::interprocess::flat_map_index; Chris@101: //! - boost::interprocess::iset_index; Chris@101: //! - boost::interprocess::iunordered_set_index; Chris@101: //! - boost::interprocess::map_index; Chris@101: //! - boost::interprocess::null_index; Chris@101: //! - boost::interprocess::unordered_map_index; Chris@101: //! Chris@101: //! The following managed memory types: Chris@101: //! - boost::interprocess::segment_manager; Chris@101: //! - boost::interprocess::basic_managed_external_buffer Chris@101: //! - boost::interprocess::managed_external_buffer Chris@101: //! - boost::interprocess::wmanaged_external_buffer Chris@101: //! - boost::interprocess::basic_managed_shared_memory Chris@101: //! - boost::interprocess::managed_shared_memory Chris@101: //! - boost::interprocess::wmanaged_shared_memory Chris@101: //! - boost::interprocess::basic_managed_windows_shared_memory Chris@101: //! - boost::interprocess::managed_windows_shared_memory Chris@101: //! - boost::interprocess::wmanaged_windows_shared_memory Chris@101: //! - boost::interprocess::basic_managed_xsi_shared_memory Chris@101: //! - boost::interprocess::managed_xsi_shared_memory Chris@101: //! - boost::interprocess::wmanaged_xsi_shared_memory Chris@101: //! - boost::interprocess::fixed_managed_shared_memory Chris@101: //! - boost::interprocess::wfixed_managed_shared_memory Chris@101: //! - boost::interprocess::basic_managed_heap_memory Chris@101: //! - boost::interprocess::managed_heap_memory Chris@101: //! - boost::interprocess::wmanaged_heap_memory Chris@101: //! - boost::interprocess::basic_managed_mapped_file Chris@101: //! - boost::interprocess::managed_mapped_file Chris@101: //! - boost::interprocess::wmanaged_mapped_file Chris@101: //! Chris@101: //! The following exception types: Chris@101: //! - boost::interprocess::interprocess_exception Chris@101: //! - boost::interprocess::lock_exception Chris@101: //! - boost::interprocess::bad_alloc Chris@101: //! Chris@101: //! The following stream types: Chris@101: //! - boost::interprocess::basic_bufferbuf Chris@101: //! - boost::interprocess::basic_ibufferstream Chris@101: //! - boost::interprocess::basic_obufferstream Chris@101: //! - boost::interprocess::basic_bufferstream Chris@101: //! - boost::interprocess::basic_vectorbuf Chris@101: //! - boost::interprocess::basic_ivectorstream Chris@101: //! - boost::interprocess::basic_ovectorstream Chris@101: //! - boost::interprocess::basic_vectorstream Chris@101: //! Chris@101: //! The following smart pointer types: Chris@101: //! - boost::interprocess::scoped_ptr Chris@101: //! - boost::interprocess::intrusive_ptr Chris@101: //! - boost::interprocess::shared_ptr Chris@101: //! - boost::interprocess::weak_ptr Chris@101: //! Chris@101: //! The following interprocess communication types: Chris@101: //! - boost::interprocess::message_queue_t; Chris@101: //! - boost::interprocess::message_queue; Chris@101: Chris@16: #include Chris@16: #include Chris@16: Chris@101: #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) Chris@101: Chris@16: #include Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Standard predeclarations Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@101: namespace boost{ namespace intrusive{ } } Chris@101: namespace boost{ namespace interprocess{ namespace bi = boost::intrusive; } } Chris@16: Chris@16: namespace boost { namespace interprocess { Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // permissions Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class permissions; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // shared_memory Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class shared_memory_object; Chris@16: Chris@101: #if defined (BOOST_INTERPROCESS_WINDOWS) Chris@16: class windows_shared_memory; Chris@16: #endif //#if defined (BOOST_INTERPROCESS_WINDOWS) Chris@16: Chris@101: #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) Chris@101: class xsi_shared_memory; Chris@101: #endif //#if defined (BOOST_INTERPROCESS_WINDOWS) Chris@101: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@101: // file mapping / mapped region Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class file_mapping; Chris@16: class mapped_region; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Mutexes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class null_mutex; Chris@16: Chris@16: class interprocess_mutex; Chris@16: class interprocess_recursive_mutex; Chris@16: Chris@16: class named_mutex; Chris@16: class named_recursive_mutex; Chris@16: Chris@16: class interprocess_semaphore; Chris@16: class named_semaphore; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Mutex families Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: struct mutex_family; Chris@16: struct null_mutex_family; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Other synchronization classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class interprocess_sharable_mutex; Chris@16: class interprocess_condition; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Locks Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class scoped_lock; Chris@16: Chris@16: template Chris@16: class sharable_lock; Chris@16: Chris@16: template Chris@16: class upgradable_lock; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // STL compatible allocators Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class allocator; Chris@16: Chris@16: template Chris@16: class node_allocator; Chris@16: Chris@16: template Chris@16: class private_node_allocator; Chris@16: Chris@16: template Chris@16: class cached_node_allocator; Chris@16: Chris@101: template< class T, class SegmentManager, std::size_t NodesPerBlock = 64 Chris@101: , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 > Chris@16: class adaptive_pool; Chris@16: Chris@101: template< class T, class SegmentManager, std::size_t NodesPerBlock = 64 Chris@101: , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 > Chris@16: class private_adaptive_pool; Chris@16: Chris@101: template< class T, class SegmentManager, std::size_t NodesPerBlock = 64 Chris@101: , std::size_t MaxFreeBlocks = 2, unsigned char OverheadPercent = 5 > Chris@16: class cached_adaptive_pool; Chris@16: Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // offset_ptr Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: static const std::size_t offset_type_alignment = 0; Chris@16: Chris@101: template < class T, class DifferenceType = std::ptrdiff_t Chris@101: , class OffsetType = std::size_t, std::size_t Alignment = offset_type_alignment> Chris@16: class offset_ptr; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Memory allocation algorithms Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: //Single segment memory allocation algorithms Chris@16: template > Chris@16: class simple_seq_fit; Chris@16: Chris@16: template, std::size_t MemAlignment = 0> Chris@16: class rbtree_best_fit; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Index Types Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template class flat_map_index; Chris@16: template class iset_index; Chris@16: template class iunordered_set_index; Chris@16: template class map_index; Chris@16: template class null_index; Chris@16: template class unordered_map_index; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Segment manager Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template class IndexType> Chris@16: class segment_manager; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // External buffer managed memory classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template class IndexType> Chris@16: class basic_managed_external_buffer; Chris@16: Chris@16: typedef basic_managed_external_buffer Chris@16: Chris@16: ,iset_index> Chris@16: managed_external_buffer; Chris@16: Chris@16: typedef basic_managed_external_buffer Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_external_buffer; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // managed memory classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template class IndexType> Chris@16: class basic_managed_shared_memory; Chris@16: Chris@16: typedef basic_managed_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: managed_shared_memory; Chris@16: Chris@16: typedef basic_managed_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_shared_memory; Chris@16: Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Windows shared memory managed memory classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@101: #if defined (BOOST_INTERPROCESS_WINDOWS) Chris@16: Chris@16: template class IndexType> Chris@16: class basic_managed_windows_shared_memory; Chris@16: Chris@16: typedef basic_managed_windows_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: managed_windows_shared_memory; Chris@16: Chris@16: typedef basic_managed_windows_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_windows_shared_memory; Chris@16: Chris@16: #endif //#if defined (BOOST_INTERPROCESS_WINDOWS) Chris@16: Chris@101: #if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) Chris@16: Chris@16: template class IndexType> Chris@16: class basic_managed_xsi_shared_memory; Chris@16: Chris@16: typedef basic_managed_xsi_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: managed_xsi_shared_memory; Chris@16: Chris@16: typedef basic_managed_xsi_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_xsi_shared_memory; Chris@16: Chris@16: #endif //#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Fixed address shared memory Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: typedef basic_managed_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: fixed_managed_shared_memory; Chris@16: Chris@16: typedef basic_managed_shared_memory Chris@16: Chris@16: ,iset_index> Chris@16: wfixed_managed_shared_memory; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Heap memory managed memory classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class IndexType> Chris@16: class basic_managed_heap_memory; Chris@16: Chris@16: typedef basic_managed_heap_memory Chris@16: Chris@16: ,iset_index> Chris@16: managed_heap_memory; Chris@16: Chris@16: typedef basic_managed_heap_memory Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_heap_memory; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Mapped file managed memory classes Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class IndexType> Chris@16: class basic_managed_mapped_file; Chris@16: Chris@16: typedef basic_managed_mapped_file Chris@16: Chris@16: ,iset_index> Chris@16: managed_mapped_file; Chris@16: Chris@16: typedef basic_managed_mapped_file Chris@16: Chris@16: ,iset_index> Chris@16: wmanaged_mapped_file; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Exceptions Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: class interprocess_exception; Chris@16: class lock_exception; Chris@16: class bad_alloc; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Bufferstream Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: //bufferstream Chris@16: template > Chris@16: class basic_bufferbuf; Chris@16: Chris@16: template > Chris@16: class basic_ibufferstream; Chris@16: Chris@16: template > Chris@16: class basic_obufferstream; Chris@16: Chris@16: template > Chris@16: class basic_bufferstream; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Vectorstream Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template > Chris@16: class basic_vectorbuf; Chris@16: Chris@16: template > Chris@16: class basic_ivectorstream; Chris@16: Chris@16: template > Chris@16: class basic_ovectorstream; Chris@16: Chris@16: template > Chris@16: class basic_vectorstream; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Smart pointers Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class scoped_ptr; Chris@16: Chris@16: template Chris@16: class intrusive_ptr; Chris@16: Chris@16: template Chris@16: class shared_ptr; Chris@16: Chris@16: template Chris@16: class weak_ptr; Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // IPC Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: class message_queue_t; Chris@16: Chris@16: typedef message_queue_t > message_queue; Chris@16: Chris@16: }} //namespace boost { namespace interprocess { Chris@16: Chris@101: #endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //#ifndef BOOST_INTERPROCESS_FWD_HPP