Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template private_adaptive_pool

boost::container::private_adaptive_pool

Synopsis

// In header: <boost/container/adaptive_pool.hpp>

template<typename T,  NodesPerBlock = , 
          MaxFreeBlocks = , 
          OverheadPercent = , 
          Version = > 
class private_adaptive_pool {
public:
  // types
  typedef                                                                                                            ;
  typedef private_adaptive_pool<  ;         
  typedef                             ;         
  typedef                                                                                                                       ;     
  typedef                                                                                                                     ;        
  typedef                                                                                                               ;  
  typedef ::                                                                         ;      
  typedef ::                                                                    ;
  typedef                                                                                                             ;      
  typedef                                                                                                          ;
  typedef self_t,                                                                  ;        

  // member classes/structs/unions
  template<typename T2> 
  struct rebind {
    // types
    typedef private_adaptive_pool<  ;
  };

  // construct/copy/destruct
  () ;
  (private_adaptive_pool &) ;
  template<typename T2> 
    (private_adaptive_pool< ) ;
  ~();

  // public member functions
   ();
   () ;
   (,  = );
   (, ) ;
   (, , , 
                             );
   () ;
   ();
   (, );
   () ;
   () ;
   (, , );
   (, , );
   () ;
   () ;

  // friend functions
   (private_adaptive_pool &, private_adaptive_pool &) ;
   (private_adaptive_pool &, 
                  private_adaptive_pool &) ;
   (private_adaptive_pool &, 
                  private_adaptive_pool &) ;

  // private member functions
   (, , , 
                                  );

  // public data members
  static  nodes_per_block;
  static  max_free_blocks;
  static  overhead_percent;
  static  real_nodes_per_block;
   m_pool;
};

Description

private_adaptive_pool public types

  1. typedef ;

    If Version is 1, the allocator is a STL conforming allocator. If Version is 2, the allocator offers advanced expand in place and burst allocation capabilities.

private_adaptive_pool public construct/copy/destruct

  1. () ;
    Default constructor.
  2. (private_adaptive_pool &) ;
    Copy constructor from other private_adaptive_pool.
  3. template<typename T2> 
      (private_adaptive_pool< ) ;
    Copy constructor from related private_adaptive_pool.
  4. ~();
    Destructor.

private_adaptive_pool public member functions

  1.  ();
  2.  () ;

    Returns the number of elements that could be allocated. Never throws

  3.  ( count,  = );

    Allocate memory for an array of count elements. Throws std::bad_alloc if there is no enough memory

  4.  ( ptr,  count) ;

    Deallocate allocated memory. Never throws

  5.  ( command,  limit_size, 
                                prefer_in_recvd_out_size, 
                                reuse);
  6.  ( p) ;

    Returns maximum the number of objects the previously allocated memory pointed by p can hold.

  7.  ();

    Allocates just one object. Memory allocated with this function must be deallocated only with deallocate_one(). Throws bad_alloc if there is no enough memory

  8.  ( num_elements, 
                              chain);

    Allocates many elements of size == 1. Elements must be individually deallocated with deallocate_one()

  9.  ( p) ;

    Deallocates memory previously allocated with allocate_one(). You should never use deallocate_one to deallocate memory allocated with other functions different from allocate_one(). Never throws

  10.  ( chain) ;
  11.  ( elem_size,  n_elements, 
                        chain);

    Allocates many elements of size elem_size. Elements must be individually deallocated with deallocate()

  12.  ( elem_sizes,  n_elements, 
                        chain);

    Allocates n_elements elements, each one of size elem_sizes[i] Elements must be individually deallocated with deallocate()

  13.  ( chain) ;
  14.  () ;
    Deallocates all free blocks of the pool.

private_adaptive_pool friend functions

  1.  (private_adaptive_pool &, private_adaptive_pool &) ;

    Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined.

  2.  (private_adaptive_pool &, private_adaptive_pool &) ;

    An allocator always compares to true, as memory allocated with one instance can be deallocated by another instance

  3.  (private_adaptive_pool &, private_adaptive_pool &) ;

    An allocator always compares to false, as memory allocated with one instance can be deallocated by another instance

private_adaptive_pool private member functions

  1.  ( command, 
                                     limit_size, 
                                     prefer_in_recvd_out_size, 
                                     reuse_ptr);

PrevUpHomeNext