IAllocator_Xfer

IAllocator_Xfer provides a type-erased interface to a specific native allocator implementation.

It supports runtime polymorphism for the cpp:class:xo::mm::AAllocator facet. Application code iis unlikely to directly interact with this class

Context

_images/ditaa-1939f29ba6d5817da412eaa0a3a24e95a1c96102.png

Each method operates by downcasting its first argument to the known target native interface type, and delegating to native interface method with the same name.

For example (paraphrasing):

template <typename DRepr, typename IAllocator_DRepr>
bool IAllocator_Xfer<DRepr, IAllocator_DRepr>::contains(Copaque d,
                                                        const void * p) const ...
{
  return IAllocator_DRepr::contains(*(DRepr*)(d), p);
};

Code for other methods follows the same pattern; in fact expect to be able to generate class definition mechanically at some point.

Application code will not normally interact with IAllocator_Xfer. It will be used once for each specific allocator implementation (e.g. with xo::mm::IAllocator_DArena). In any case, can include the transfer template with:

#include <xo/alloc2/IAllocator_Xfer.hpp>

Class

Warning

doxygenclass: Cannot find class “xo::mm::IAllocator_Xfer” in doxygen xml output for project “xodoxxml” from directory: /build/xo-alloc2/build/docs/dox/xml

Types

Warning

doxygengroup: Cannot find group “mm-allocator-xfer-types” in doxygen xml output for project “xodoxxml” from directory: /build/xo-alloc2/build/docs/dox/xml

Methods

Warning

doxygengroup: Cannot find group “mm-allocator-xfer-methods” in doxygen xml output for project “xodoxxml” from directory: /build/xo-alloc2/build/docs/dox/xml