Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template segment_manager_base

boost::interprocess::segment_manager_base

Synopsis

// In header: <boost/interprocess/segment_manager.hpp>

template<typename MemoryAlgorithm> 
class segment_manager_base : private  {
public:
  // types
  typedef segment_manager_base<  ;
  typedef            ;             
  typedef            ;             
  typedef                          ;         
  typedef   ;    
  typedef         ;          
  typedef               ;                

  // construct/copy/destruct
  (, );

  // public member functions
   () ;
   () ;
   (, );
   (, , );
   (, , , 
                     );
   (, , , 
                     );
   (, , , 
                     , );
   ();
   ();
   (, , );
   (, );
  template<typename T> 
     (, , 
                           , );
   (, 
                                , , , 
                                 = );
   ();
   ();
   ();
   ();
   ();
   ();
   () ;

  // public static functions
   ();

  // protected member functions
   (, , );
   (, );

  // public data members
  static  ;
};

Description

This object is the public base class of segment manager. This class only depends on the memory allocation algorithm and implements all the allocation features not related to named or unique objects.

Storing a reference to segment_manager forces the holder class to be dependent on index types and character types. When such dependence is not desirable and only anonymous and raw allocations are needed, segment_manager_base is the correct answer.

segment_manager_base public construct/copy/destruct

  1. ( sz,  reserved_bytes);

    Constructor of the segment_manager_base

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

    "reserved_bytes" is the number of bytes after the end of the memory algorithm object itself that the memory algorithm will exclude from dynamic allocation

    Can throw

segment_manager_base public member functions

  1.  () ;

    Returns the size of the memory segment

  2.  () ;

    Returns the number of free bytes of the memory segment

  3.  ( nbytes, );

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

  4.  ( elem_bytes,  n_elements, 
                        chain);

    Allocates n_elements of elem_bytes bytes. Throws bad_alloc on failure. chain.size() is not increased on failure.

  5.  ( element_lengths,  n_elements, 
                        sizeof_element,  chain);

    Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes. Throws bad_alloc on failure. chain.size() is not increased on failure.

  6.  (,  elem_bytes, 
                        n_elements,  chain);

    Allocates n_elements of elem_bytes bytes. Non-throwing version. chain.size() is not increased on failure.

  7.  (,  elem_sizes, 
                        n_elements,  sizeof_element, 
                        chain);

    Allocates n_elements, each one of element_lengths[i]*sizeof_element bytes. Non-throwing version. chain.size() is not increased on failure.

  8.  ( chain);

    Deallocates all elements contained in chain. Never throws.

  9.  ( nbytes);

    Allocates nbytes bytes. Throws boost::interprocess::bad_alloc on failure

  10.  ( nbytes,  alignment, 
                            );

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

  11.  ( nbytes,  alignment);

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

  12. template<typename T> 
       ( command, 
                              limit_size, 
                              prefer_in_recvd_out_size,  reuse);
  13.  ( command, 
                                   limit_objects, 
                                   prefer_in_recvd_out_size, 
                                   reuse,  sizeof_object = );
  14.  ( addr);

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

  15.  ( extra_size);

    Increases managed memory in extra_size bytes more. This only works with single-segment management.

  16.  ();

    Decreases managed memory to the minimum. This only works with single-segment management.

  17.  ();

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

  18.  ();

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

  19.  ();

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

  20.  ( ptr) ;
    Returns the size of the buffer previously allocated pointed by ptr.

segment_manager_base public static functions

  1.  ( size);

    Obtains the minimum size needed by the segment manager

segment_manager_base protected member functions

  1.  ( num,  dothrow, 
                                     table);
  2.  ( object,  table);
    Calls the destructor and makes an anonymous deallocate.

segment_manager_base public public data members

  1. static  ;

    This constant indicates the payload size associated with each allocation of the memory algorithm


PrevUpHomeNext