Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType > Class Template Reference

This object is placed in the beginning of memory segment and implements the allocation (named or anonymous) of portions of the segment. More...

#include <segment_manager.hpp>

Inheritance diagram for boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >:
Collaboration diagram for boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >:

Classes

struct  allocator
 This is the default allocator to allocate types T from this managed segment. More...
 
struct  construct_iter_proxy
 Constructor proxy object definition helper class. More...
 
struct  construct_proxy
 Constructor proxy object definition helper class. More...
 
struct  deleter
 This is the default deleter to delete types T from this managed segment. More...
 

Public Types

typedef MemoryAlgorithm memory_algorithm
 
typedef
segment_manager_base_t::void_pointer 
void_pointer
 
typedef
segment_manager_base_t::size_type 
size_type
 
typedef
segment_manager_base_t::difference_type 
difference_type
 
typedef CharType char_type
 
typedef segment_manager_base
< MemoryAlgorithm > 
segment_manager_base_type
 
typedef IndexType
< index_config_named > 
named_index_t
 
typedef IndexType
< index_config_unique > 
unique_index_t
 
typedef
ipcdetail::char_ptr_holder
< CharType > 
char_ptr_holder_t
 
typedef
ipcdetail::segment_manager_iterator_transform
< typename
named_index_t::const_iterator,is_intrusive_index
< index_type >::value > 
named_transform
 
typedef
ipcdetail::segment_manager_iterator_transform
< typename
unique_index_t::const_iterator,is_intrusive_index
< index_type >::value > 
unique_transform
 
typedef
segment_manager_base_t::mutex_family 
mutex_family
 
typedef transform_iterator
< typename
named_index_t::const_iterator,
named_transform
const_named_iterator
 
typedef transform_iterator
< typename
unique_index_t::const_iterator,
unique_transform
const_unique_iterator
 
typedef
MemoryAlgorithm::multiallocation_chain 
multiallocation_chain
 

Public Member Functions

 segment_manager (size_type segment_size)
 Constructor of the segment manager "size" is the size of the memory segment where the segment manager is being constructed. More...
 
template<class T >
std::pair< T *, size_typefind (char_ptr_holder_t name)
 Tries to find a previous named/unique allocation. More...
 
template<class T >
std::pair< T *, size_typefind_no_lock (char_ptr_holder_t name)
 Tries to find a previous named/unique allocation. More...
 
template<class T >
construct_proxy< T >::type construct (char_ptr_holder_t name)
 Returns throwing "construct" proxy object. More...
 
template<class T >
construct_proxy< T >::type find_or_construct (char_ptr_holder_t name)
 Returns throwing "search or construct" proxy object. More...
 
template<class T >
construct_proxy< T >::type construct (char_ptr_holder_t name, std::nothrow_t)
 Returns no throwing "construct" proxy object. More...
 
template<class T >
construct_proxy< T >::type find_or_construct (char_ptr_holder_t name, std::nothrow_t)
 Returns no throwing "search or construct" proxy object. More...
 
template<class T >
construct_iter_proxy< T >::type construct_it (char_ptr_holder_t name)
 Returns throwing "construct from iterators" proxy object. More...
 
template<class T >
construct_iter_proxy< T >::type find_or_construct_it (char_ptr_holder_t name)
 Returns throwing "search or construct from iterators" proxy object. More...
 
template<class T >
construct_iter_proxy< T >::type construct_it (char_ptr_holder_t name, std::nothrow_t)
 Returns no throwing "construct from iterators" proxy object. More...
 
template<class T >
construct_iter_proxy< T >::type find_or_construct_it (char_ptr_holder_t name, std::nothrow_t)
 Returns no throwing "search or construct from iterators" proxy object. More...
 
template<class Func >
void atomic_func (Func &f)
 Calls object function blocking recursive interprocess_mutex and guarantees that no new named_alloc or destroy will be executed by any process while executing the object function call. More...
 
template<class Func >
bool try_atomic_func (Func &f)
 Tries to calls a functor guaranteeing that no new construction, search or destruction will be executed by any process while executing the object function call. More...
 
template<class T >
bool destroy (char_ptr_holder_t name)
 Destroys a previously created named/unique instance. More...
 
template<class T >
void destroy_ptr (const T *p)
 Destroys an anonymous, unique or named object using its address. More...
 
void reserve_named_objects (size_type num)
 Preallocates needed index resources to optimize the creation of "num" named objects in the managed memory segment. More...
 
void reserve_unique_objects (size_type num)
 Preallocates needed index resources to optimize the creation of "num" unique objects in the managed memory segment. More...
 
void shrink_to_fit_indexes ()
 Calls shrink_to_fit in both named and unique object indexes to try to free unused memory from those indexes. More...
 
size_type get_num_named_objects ()
 Returns the number of named objects stored in the segment. More...
 
size_type get_num_unique_objects ()
 Returns the number of unique objects stored in the segment. More...
 
const_named_iterator named_begin () const
 Returns a constant iterator to the beginning of the information about the named allocations performed in this segment manager. More...
 
const_named_iterator named_end () const
 Returns a constant iterator to the end of the information about the named allocations performed in this segment manager. More...
 
const_unique_iterator unique_begin () const
 Returns a constant iterator to the beginning of the information about the unique allocations performed in this segment manager. More...
 
const_unique_iterator unique_end () const
 Returns a constant iterator to the end of the information about the unique allocations performed in this segment manager. More...
 
template<class T >
allocator< T >::type get_allocator ()
 Returns an instance of the default allocator for type T initialized that allocates memory from this segment manager. More...
 
template<class T >
deleter< T >::type get_deleter ()
 Returns an instance of the default deleter for type T that will delete an object constructed in this segment manager. More...
 
template<class T >
Tgeneric_construct (const CharType *name, size_type num, bool try2find, bool dothrow, ipcdetail::in_place_interface &table)
 Generic named/anonymous new function. More...
 
size_type get_size () const
 Returns the size of the memory segment. More...
 
size_type get_free_memory () const
 Returns the number of free bytes of the memory segment. More...
 
void * allocate (size_type nbytes, std::nothrow_t)
 Allocates nbytes bytes. More...
 
void * allocate (size_type nbytes)
 Allocates nbytes bytes. More...
 
void allocate_many (size_type elem_bytes, size_type n_elements, multiallocation_chain &chain)
 Allocates n_elements of elem_bytes bytes. More...
 
void allocate_many (const size_type *element_lengths, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain)
 Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes. More...
 
void allocate_many (std::nothrow_t, size_type elem_bytes, size_type n_elements, multiallocation_chain &chain)
 Allocates n_elements of elem_bytes bytes. More...
 
void allocate_many (std::nothrow_t, const size_type *elem_sizes, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain)
 Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes. More...
 
void deallocate_many (multiallocation_chain &chain)
 Deallocates all elements contained in chain. More...
 
void * allocate_aligned (size_type nbytes, size_type alignment, std::nothrow_t)
 Allocates nbytes bytes. More...
 
void * allocate_aligned (size_type nbytes, size_type alignment)
 Allocates nbytes bytes. More...
 
template<class T >
std::pair< T *, bool > allocation_command (boost::interprocess::allocation_type command, size_type limit_size, size_type preferred_size, size_type &received_size, T *reuse_ptr=0)
 
std::pair< void *, bool > raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_objects, size_type preferred_objects, size_type &received_objects, void *reuse_ptr=0, size_type sizeof_object=1)
 
void deallocate (void *addr)
 Deallocates the bytes allocated with allocate/allocate_many() pointed by addr. More...
 
void grow (size_type extra_size)
 Increases managed memory in extra_size bytes more. More...
 
void shrink_to_fit ()
 Decreases managed memory to the minimum. More...
 
bool all_memory_deallocated ()
 Returns the result of "all_memory_deallocated()" function of the used memory algorithm. More...
 
bool check_sanity ()
 Returns the result of "check_sanity()" function of the used memory algorithm. More...
 
void zero_free_memory ()
 Writes to zero free memory (memory not yet allocated) of the memory algorithm. More...
 
size_type size (const void *ptr) const
 Returns the size of the buffer previously allocated pointed by ptr. More...
 

Static Public Member Functions

template<class T >
static const CharType * get_instance_name (const T *ptr)
 Returns the name of an object created with construct/find_or_construct functions. More...
 
template<class T >
static size_type get_instance_length (const T *ptr)
 Returns the length of an object created with construct/find_or_construct functions. More...
 
template<class T >
static instance_type get_instance_type (const T *ptr)
 Returns is the the name of an object created with construct/find_or_construct functions. More...
 
static size_type get_min_size ()
 Obtains the minimum size needed by the segment manager. More...
 
static size_type get_min_size (size_type size)
 Obtains the minimum size needed by the segment manager. More...
 

Static Public Attributes

static const size_type PayloadPerAllocation = segment_manager_base_t::PayloadPerAllocation
 

Protected Member Functions

void * prot_anonymous_construct (size_type num, bool dothrow, ipcdetail::in_place_interface &table)
 
void prot_anonymous_destroy (const void *object, ipcdetail::in_place_interface &table)
 Calls the destructor and makes an anonymous deallocate. More...
 

Detailed Description

template<class CharType, class MemoryAlgorithm, template< class IndexConfig > class IndexType>
class boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >

This object is placed in the beginning of memory segment and implements the allocation (named or anonymous) of portions of the segment.

This object contains two indexes that maintain an association between a name and a portion of the segment.

The first index contains the mappings for normal named objects using the char type specified in the template parameter.

The second index contains the association for unique instances. The key will be the const char * returned from type_info.name() function for the unique type to be constructed.

segment_manager<CharType, MemoryAlgorithm, IndexType> inherits publicly from segment_manager_base<MemoryAlgorithm> and inherits from it many public functions related to anonymous object and raw memory allocation. See segment_manager_base reference to know about those functions.

Member Typedef Documentation

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef ipcdetail::char_ptr_holder<CharType> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::char_ptr_holder_t
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef CharType boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::char_type
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef transform_iterator<typename named_index_t::const_iterator, named_transform> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::const_named_iterator
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef transform_iterator<typename unique_index_t::const_iterator, unique_transform> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::const_unique_iterator
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef segment_manager_base_t::difference_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::difference_type
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef MemoryAlgorithm boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::memory_algorithm
template<class MemoryAlgorithm >
typedef MemoryAlgorithm::multiallocation_chain boost::interprocess::segment_manager_base< MemoryAlgorithm >::multiallocation_chain
inherited
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef segment_manager_base_t::mutex_family boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::mutex_family
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef IndexType<index_config_named> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::named_index_t
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef ipcdetail::segment_manager_iterator_transform<typename named_index_t::const_iterator ,is_intrusive_index<index_type>::value> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::named_transform
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef segment_manager_base<MemoryAlgorithm> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::segment_manager_base_type
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef segment_manager_base_t::size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::size_type
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef IndexType<index_config_unique> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::unique_index_t
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef ipcdetail::segment_manager_iterator_transform<typename unique_index_t::const_iterator ,is_intrusive_index<index_type>::value> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::unique_transform
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
typedef segment_manager_base_t::void_pointer boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::void_pointer

Constructor & Destructor Documentation

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::segment_manager ( size_type  segment_size)
inlineexplicit

Constructor of the segment manager "size" is the size of the memory segment where the segment manager is being constructed.

Can throw

References BOOST_ASSERT, and boost::detail::void.

Member Function Documentation

template<class MemoryAlgorithm >
bool boost::interprocess::segment_manager_base< MemoryAlgorithm >::all_memory_deallocated ( )
inlineinherited

Returns the result of "all_memory_deallocated()" function of the used memory algorithm.

template<class MemoryAlgorithm >
void* boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate ( size_type  nbytes,
std::nothrow_t   
)
inlineinherited

Allocates nbytes bytes.

This function is only used in single-segment management. Never throws

Referenced by boost::interprocess::segment_manager_base< MemoryAlgorithm >::prot_anonymous_construct().

template<class MemoryAlgorithm >
void* boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate ( size_type  nbytes)
inlineinherited

Allocates nbytes bytes.

Throws boost::interprocess::bad_alloc on failure

template<class MemoryAlgorithm >
void* boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_aligned ( size_type  nbytes,
size_type  alignment,
std::nothrow_t   
)
inlineinherited

Allocates nbytes bytes.

This function is only used in single-segment management. Never throws

template<class MemoryAlgorithm >
void* boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_aligned ( size_type  nbytes,
size_type  alignment 
)
inlineinherited

Allocates nbytes bytes.

This function is only used in single-segment management. Throws bad_alloc when fails

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_many ( size_type  elem_bytes,
size_type  n_elements,
multiallocation_chain chain 
)
inlineinherited

Allocates n_elements of elem_bytes bytes.

Throws bad_alloc on failure. chain.size() is not increased on failure.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_many ( const size_type element_lengths,
size_type  n_elements,
size_type  sizeof_element,
multiallocation_chain chain 
)
inlineinherited

Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes.

Throws bad_alloc on failure. chain.size() is not increased on failure.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_many ( std::nothrow_t  ,
size_type  elem_bytes,
size_type  n_elements,
multiallocation_chain chain 
)
inlineinherited

Allocates n_elements of elem_bytes bytes.

Non-throwing version. chain.size() is not increased on failure.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocate_many ( std::nothrow_t  ,
const size_type elem_sizes,
size_type  n_elements,
size_type  sizeof_element,
multiallocation_chain chain 
)
inlineinherited

Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes.

Non-throwing version. chain.size() is not increased on failure.

template<class MemoryAlgorithm >
template<class T >
std::pair<T *, bool> boost::interprocess::segment_manager_base< MemoryAlgorithm >::allocation_command ( boost::interprocess::allocation_type  command,
size_type  limit_size,
size_type  preferred_size,
size_type received_size,
T reuse_ptr = 0 
)
inlineinherited
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class Func >
void boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::atomic_func ( Func &  f)
inline

Calls object function blocking recursive interprocess_mutex and guarantees that no new named_alloc or destroy will be executed by any process while executing the object function call.

template<class MemoryAlgorithm >
bool boost::interprocess::segment_manager_base< MemoryAlgorithm >::check_sanity ( )
inlineinherited

Returns the result of "check_sanity()" function of the used memory algorithm.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::construct ( char_ptr_holder_t  name)
inline

Returns throwing "construct" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::construct ( char_ptr_holder_t  name,
std::nothrow_t   
)
inline

Returns no throwing "construct" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_iter_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::construct_it ( char_ptr_holder_t  name)
inline

Returns throwing "construct from iterators" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_iter_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::construct_it ( char_ptr_holder_t  name,
std::nothrow_t   
)
inline

Returns no throwing "construct from iterators" proxy object.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::deallocate ( void *  addr)
inlineinherited

Deallocates the bytes allocated with allocate/allocate_many() pointed by addr.

Referenced by boost::interprocess::segment_manager_base< MemoryAlgorithm >::prot_anonymous_destroy().

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::deallocate_many ( multiallocation_chain chain)
inlineinherited

Deallocates all elements contained in chain.

Never throws.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
bool boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::destroy ( char_ptr_holder_t  name)
inline

Destroys a previously created named/unique instance.

Returns false if the object was not present.

References BOOST_ASSERT, boost::iostreams::gzip::flags::name, and T.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
void boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::destroy_ptr ( const T p)
inline

Destroys an anonymous, unique or named object using its address.

References boost::detail::type.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
std::pair<T*, size_type> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find ( char_ptr_holder_t  name)
inline

Tries to find a previous named/unique allocation.

Returns the address and the object count. On failure the first member of the returned pair is 0.

References boost::iostreams::gzip::flags::name.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
std::pair<T*, size_type> boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find_no_lock ( char_ptr_holder_t  name)
inline

Tries to find a previous named/unique allocation.

Returns the address and the object count. On failure the first member of the returned pair is 0. This search is not mutex-protected! Use it only inside atomic_func() calls, where the internal mutex is guaranteed to be locked.

References boost::iostreams::gzip::flags::name.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find_or_construct ( char_ptr_holder_t  name)
inline

Returns throwing "search or construct" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find_or_construct ( char_ptr_holder_t  name,
std::nothrow_t   
)
inline

Returns no throwing "search or construct" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_iter_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find_or_construct_it ( char_ptr_holder_t  name)
inline

Returns throwing "search or construct from iterators" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
construct_iter_proxy<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::find_or_construct_it ( char_ptr_holder_t  name,
std::nothrow_t   
)
inline

Returns no throwing "search or construct from iterators" proxy object.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
T* boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::generic_construct ( const CharType *  name,
size_type  num,
bool  try2find,
bool  dothrow,
ipcdetail::in_place_interface &  table 
)
inline

Generic named/anonymous new function.

Offers all the possibilities, such as throwing, search before creating, and the constructor is encapsulated in an object function.

References T.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
allocator<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_allocator ( void  )
inline

Returns an instance of the default allocator for type T initialized that allocates memory from this segment manager.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
deleter<T>::type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_deleter ( )
inline

Returns an instance of the default deleter for type T that will delete an object constructed in this segment manager.

template<class MemoryAlgorithm >
size_type boost::interprocess::segment_manager_base< MemoryAlgorithm >::get_free_memory ( ) const
inlineinherited

Returns the number of free bytes of the memory segment.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
static size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_instance_length ( const T ptr)
inlinestatic

Returns the length of an object created with construct/find_or_construct functions.

Does not throw.

References T.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
static const CharType* boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_instance_name ( const T ptr)
inlinestatic

Returns the name of an object created with construct/find_or_construct functions.

Does not throw

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class T >
static instance_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_instance_type ( const T ptr)
inlinestatic

Returns is the the name of an object created with construct/find_or_construct functions.

Does not throw

template<class MemoryAlgorithm >
static size_type boost::interprocess::segment_manager_base< MemoryAlgorithm >::get_min_size ( size_type  size)
inlinestaticinherited

Obtains the minimum size needed by the segment manager.

Referenced by boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_min_size().

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
static size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_min_size ( )
inlinestatic

Obtains the minimum size needed by the segment manager.

References boost::interprocess::segment_manager_base< MemoryAlgorithm >::get_min_size().

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_num_named_objects ( )
inline

Returns the number of named objects stored in the segment.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::get_num_unique_objects ( )
inline

Returns the number of unique objects stored in the segment.

template<class MemoryAlgorithm >
size_type boost::interprocess::segment_manager_base< MemoryAlgorithm >::get_size ( ) const
inlineinherited

Returns the size of the memory segment.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::grow ( size_type  extra_size)
inlineinherited

Increases managed memory in extra_size bytes more.

This only works with single-segment management.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
const_named_iterator boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::named_begin ( ) const
inline

Returns a constant iterator to the beginning of the information about the named allocations performed in this segment manager.

References boost::iterators::make_transform_iterator().

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
const_named_iterator boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::named_end ( ) const
inline

Returns a constant iterator to the end of the information about the named allocations performed in this segment manager.

References boost::iterators::make_transform_iterator().

template<class MemoryAlgorithm >
void* boost::interprocess::segment_manager_base< MemoryAlgorithm >::prot_anonymous_construct ( size_type  num,
bool  dothrow,
ipcdetail::in_place_interface &  table 
)
inlineprotectedinherited
template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::prot_anonymous_destroy ( const void *  object,
ipcdetail::in_place_interface &  table 
)
inlineprotectedinherited

Calls the destructor and makes an anonymous deallocate.

References BOOST_ASSERT, and boost::interprocess::segment_manager_base< MemoryAlgorithm >::deallocate().

template<class MemoryAlgorithm >
std::pair<void *, bool> boost::interprocess::segment_manager_base< MemoryAlgorithm >::raw_allocation_command ( boost::interprocess::allocation_type  command,
size_type  limit_objects,
size_type  preferred_objects,
size_type received_objects,
void *  reuse_ptr = 0,
size_type  sizeof_object = 1 
)
inlineinherited
template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
void boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::reserve_named_objects ( size_type  num)
inline

Preallocates needed index resources to optimize the creation of "num" named objects in the managed memory segment.

Can throw boost::interprocess::bad_alloc if there is no enough memory.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
void boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::reserve_unique_objects ( size_type  num)
inline

Preallocates needed index resources to optimize the creation of "num" unique objects in the managed memory segment.

Can throw boost::interprocess::bad_alloc if there is no enough memory.

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::shrink_to_fit ( )
inlineinherited

Decreases managed memory to the minimum.

This only works with single-segment management.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
void boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::shrink_to_fit_indexes ( )
inline

Calls shrink_to_fit in both named and unique object indexes to try to free unused memory from those indexes.

template<class MemoryAlgorithm >
size_type boost::interprocess::segment_manager_base< MemoryAlgorithm >::size ( const void *  ptr) const
inlineinherited

Returns the size of the buffer previously allocated pointed by ptr.

References boost::fusion::size().

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
template<class Func >
bool boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::try_atomic_func ( Func &  f)
inline

Tries to calls a functor guaranteeing that no new construction, search or destruction will be executed by any process while executing the object function call.

If the atomic function can't be immediatelly executed because the internal mutex is already locked, returns false. If the functor throws, this function throws.

References boost::try_to_lock.

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
const_unique_iterator boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::unique_begin ( ) const
inline

Returns a constant iterator to the beginning of the information about the unique allocations performed in this segment manager.

References boost::iterators::make_transform_iterator().

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
const_unique_iterator boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::unique_end ( ) const
inline

Returns a constant iterator to the end of the information about the unique allocations performed in this segment manager.

References boost::iterators::make_transform_iterator().

template<class MemoryAlgorithm >
void boost::interprocess::segment_manager_base< MemoryAlgorithm >::zero_free_memory ( )
inlineinherited

Writes to zero free memory (memory not yet allocated) of the memory algorithm.

Member Data Documentation

template<class CharType , class MemoryAlgorithm , template< class IndexConfig > class IndexType>
const size_type boost::interprocess::segment_manager< CharType, MemoryAlgorithm, IndexType >::PayloadPerAllocation = segment_manager_base_t::PayloadPerAllocation
static

The documentation for this class was generated from the following files: