![]() |
Home | Libraries | People | FAQ | More |
boost::interprocess::segment_manager
// In header: <boost/interprocess/segment_manager.hpp> template<typename CharType, typename MemoryAlgorithm, IndexType> class segment_manager : public { public: // types typedef ; typedef ; typedef ; typedef ; typedef ; typedef segment_manager_base< ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; // member classes/structs/unions template<typename T> struct allocator { // types typedef boost::interprocess::allocator< segment_manager > ; }; // Constructor proxy object definition helper class. template<typename T> struct construct_iter_proxy { // types typedef ; }; // Constructor proxy object definition helper class. template<typename T> struct construct_proxy { // types typedef ; }; template<typename T> struct deleter { // types typedef boost::interprocess::deleter< segment_manager > ; }; struct header_t : public { // construct/copy/destruct (segment_manager_base_t *); // public data members m_named_index; m_unique_index; }; // construct/copy/destruct (); (segment_manager &); (); segment_manager & (segment_manager &); // private member functions template<typename T> (, ); template<typename T> (, ); (, , , , ); (, ); template<typename CharT> (, , , , , ); template<typename CharT> (, , , , , ); template<typename CharT> (, , , ); template<typename CharT> (, , , ); template<typename CharT> (, , , ); template<typename CharT> (, , , ); template<typename CharT> (, , ); template<typename CharT> (, , , , , , , ); template<typename CharT> (, , , , , , , ); segment_manager * (); scoped_lock< (); // public member functions template<typename T> (); template<typename T> (); template<typename T> construct_proxy< (); template<typename T> construct_proxy< (); template<typename T> construct_proxy< (, ); template<typename T> construct_proxy< (, ); template<typename T> construct_iter_proxy< (); template<typename T> construct_iter_proxy< (); template<typename T> construct_iter_proxy< (, ); template<typename T> construct_iter_proxy< (, ); template<typename Func> (); template<typename Func> (); template<typename T> (); template<typename T> (); (); (); (); (); (); () ; () ; () ; () ; template<typename T> allocator< (); template<typename T> deleter< (); template<typename T> (, , , , ); // public static functions template<typename T> (); template<typename T> (); template<typename T> (); (); // private static functions (); (, ); (); (); // public data members static PayloadPerAllocation; };
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.
segment_manager
public
construct/copy/destruct();
(segment_manager &);
( segment_size);
Constructor of the segment manager "size" is the size of the memory segment where the segment manager is being constructed. Can throw
segment_manager & (segment_manager &);
segment_manager
private member functionstemplate<typename T> ( name, lock);
Tries to find a previous named allocation. Returns the address and the object count. On failure the first member of the returned pair is 0.
template<typename T> ( name, lock);
Tries to find a previous unique allocation. Returns the address and the object count. On failure the first member of the returned pair is 0.
( name, num, try2find, dothrow, table);
( ptr, dtor);
template<typename CharT> ( name, index, table, length, is_intrusive, use_lock);
template<typename CharT> ( name, index, table, length, is_intrusive, use_lock);
template<typename CharT> ( block_header, index, table, is_node_index);
template<typename CharT> ( block_header, index, table, is_node_index);
template<typename CharT> ( name, index, table, is_intrusive_index);
template<typename CharT> ( name, index, table, is_intrusive_index);
template<typename CharT> ( it, index, table);
template<typename CharT> ( type, name, num, try2find, dothrow, table, index, is_intrusive);
template<typename CharT> ( type, name, num, try2find, dothrow, table, index, is_intrusive);
Generic named new function for named functions
segment_manager * ();Returns the this pointer.
scoped_lock< ( use_lock);
segment_manager
public member functionstemplate<typename T> ( name);
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.
template<typename T> ( name);
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.
template<typename T> construct_proxy< ( name);
Returns throwing "construct" proxy object
template<typename T> construct_proxy< ( name);
Returns throwing "search or construct" proxy object
template<typename T> construct_proxy< ( name, );
Returns no throwing "construct" proxy object
template<typename T> construct_proxy< ( name, );
Returns no throwing "search or construct" proxy object
template<typename T> construct_iter_proxy< ( name);Returns throwing "construct from iterators" proxy object.
template<typename T> construct_iter_proxy< ( name);
Returns throwing "search or construct from iterators" proxy object
template<typename T> construct_iter_proxy< ( name, );
Returns no throwing "construct from iterators" proxy object
template<typename T> construct_iter_proxy< ( name, );
Returns no throwing "search or construct from iterators" proxy object
template<typename 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
template<typename 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. 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.
template<typename T> ( name);
Destroys a previously created named/unique instance. Returns false if the object was not present.
template<typename T> ( p);
Destroys an anonymous, unique or named object using its address
( num);
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.
( num);
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.
();
Calls shrink_to_fit in both named and unique object indexes to try to free unused memory from those indexes.
();
Returns the number of named objects stored in the segment.
();
Returns the number of unique objects stored in the segment.
() ;
Returns a constant iterator to the beginning of the information about the named allocations performed in this segment manager
() ;
Returns a constant iterator to the end of the information about the named allocations performed in this segment manager
() ;
Returns a constant iterator to the beginning of the information about the unique allocations performed in this segment manager
() ;
Returns a constant iterator to the end of the information about the unique allocations performed in this segment manager
template<typename T> allocator< ();
Returns an instance of the default allocator for type T initialized that allocates memory from this segment manager.
template<typename T> deleter< ();
Returns an instance of the default deleter for type T that will delete an object constructed in this segment manager.
template<typename T> ( name, num, try2find, dothrow, table);
Generic named/anonymous new function. Offers all the possibilities, such as throwing, search before creating, and the constructor is encapsulated in an object function.
segment_manager
public static functionstemplate<typename T> ( ptr);
Returns the name of an object created with construct/find_or_construct functions. Does not throw
template<typename T> ( ptr);
Returns the length of an object created with construct/find_or_construct functions. Does not throw.
template<typename T> ( ptr);
Returns is the the name of an object created with construct/find_or_construct functions. Does not throw
();
Obtains the minimum size needed by the segment manager