CXXR (C++ R) API
Public Types | Public Member Functions
CXXR::Allocator< T > Class Template Reference

STL-compatible allocator front-ending CXXR::MemoryBank. More...

#include <Allocator.hpp>

List of all members.

Public Types

typedef T value_type
typedef T * pointer
typedef const T * const_pointer
typedef T & reference
typedef const T & const_reference
typedef std::size_t size_type
typedef std::ptrdiff_t difference_type

Public Member Functions

pointer address (reference value) const
const_pointer address (const_reference value) const
 Allocator (const Allocator &) throw ()
template<class U >
 Allocator (const Allocator< U > &) throw ()
size_type max_size () const throw ()
pointer allocate (size_type num, const void *=0)
void construct (pointer p, const T &value)
void destroy (pointer p)
void deallocate (pointer p, size_type num)

Detailed Description

template<typename T>
class CXXR::Allocator< T >

STL-compatible allocator front-ending CXXR::MemoryBank.

This templated class enables container classes within the C++ standard library to allocate their memory via CXXR::MemoryBank. However, its calls to MemoryBank are configured so that they do not give rise to garbage collections: this is to avoid any reentrant calls to the code for C++ standard library containers.

The code below is adapted from an example in the book "The C++ Standard Library - A Tutorial and Reference" by Nicolai M. Josuttis, Addison-Wesley, 1999. Also see Item 10 of Meyers' 'Effective STL' for the arcana of STL allocators.


The documentation for this class was generated from the following file: