Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template resource_adaptor_imp

boost::container::pmr::resource_adaptor_imp

Synopsis

// In header: <boost/container/pmr/resource_adaptor.hpp>

template<typename Allocator> 
class resource_adaptor_imp : public  {
public:
  // types
  typedef  ;

  // construct/copy/destruct
  ();
  (resource_adaptor_imp &);
  (resource_adaptor_imp &&);
  ();
  ();
  resource_adaptor_imp & (resource_adaptor_imp &);
  resource_adaptor_imp & (resource_adaptor_imp &&);

  // public member functions
   ();
   () ;

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

  // private member functions
   (, );
   (, , );

  // private static functions
   ();
   ();
   ();
};

Description

An instance of resource_adaptor<Allocator> is an adaptor that wraps a memory_resource interface around Allocator. In order that resource_adaptor<X<T>> and resource_adaptor<X<U>> are the same type for any allocator template X and types T and U, resource_adaptor<Allocator> is rendered as an alias to this class template such that Allocator is rebound to a char value type in every specialization of the class template. The requirements on this class template are defined below. In addition to the Allocator requirements, the parameter to resource_adaptor shall meet the following additional requirements:

resource_adaptor_imp public construct/copy/destruct

  1. ();

    Effects: Default constructs m_alloc.

  2. (resource_adaptor_imp & other);

    Effects: Copy constructs m_alloc.

  3. (resource_adaptor_imp && other);

    Effects: Move constructs m_alloc.

  4. ( a2);

    Effects: Initializes m_alloc with a2.

  5. ( a2);

    Effects: Initializes m_alloc with a2.

  6. resource_adaptor_imp & (resource_adaptor_imp & other);

    Effects: Copy assigns m_alloc.

  7. resource_adaptor_imp & (resource_adaptor_imp && other);

    Effects: Move assigns m_alloc.

resource_adaptor_imp public member functions

  1.  ();
    Effects: Returns m_alloc.
  2.  () ;
    Effects: Returns m_alloc.

resource_adaptor_imp protected member functions

  1.  ( bytes,  alignment);

    Returns: Allocated memory obtained by calling m_alloc.allocate. The size and alignment of the allocated memory shall meet the requirements for a class derived from memory_resource.

  2.  ( p,  bytes,  alignment);

    Requires: p was previously allocated using A.allocate, where A == m_alloc, and not subsequently deallocated.

    Effects: Returns memory to the allocator using m_alloc.deallocate().

  3.  (memory_resource & other) ;

    Let p be dynamic_cast<const resource_adaptor_imp*>(&other).

    Returns: false if p is null, otherwise the value of m_alloc == p->m_alloc.

resource_adaptor_imp private member functions

  1.  ( bytes,  alignment);
  2.  ( aligned_ptr,  bytes, 
                               alignment);

resource_adaptor_imp private static functions

  1.  ( aligned_ptr);
  2.  ( alignment);
  3.  ();

PrevUpHomeNext