logog
logger optimized for games
Allocator< T > Class Template Reference

#include <object.hpp>

Classes

struct  rebind
 

Public Types

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

Public Member Functions

 Allocator ()
 
 Allocator (const Allocator &)
 
pointer allocate (size_type n, const void *=0)
 
void deallocate (void *p, size_type)
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
Allocator< T > & operator= (const Allocator &)
 
void construct (pointer p, const T &val)
 
void destroy (pointer p)
 
size_type max_size () const
 
template<class U >
 Allocator (const Allocator< U > &)
 
template<class U >
Allocatoroperator= (const Allocator< U > &)
 

Detailed Description

template<class T>
class logog::Allocator< T >

An STL-compatible allocator which redirects all memory requests to the logog allocator. Used for all STL-like classes within logog.

Member Typedef Documentation

typedef const T* const_pointer

A const pointer to T type.

typedef const T& const_reference

A const reference to T type.

typedef ptrdiff_t difference_type

Memory allocation comparison type.

typedef T* pointer

A pointer to T type.

typedef T& reference

A reference to T type.

typedef size_t size_type

Memory allocation size type.

typedef T value_type

A value type (T itself).

Constructor & Destructor Documentation

Allocator ( )
inline
Allocator ( const Allocator< T > &  )
inline

Not implemented here – required by the STL standard though.

Allocator ( const Allocator< U > &  )
inline

Required by STL – unused here.

Member Function Documentation

pointer address ( reference  x) const
inline

Returns the address of a reference to T.

const_pointer address ( const_reference  x) const
inline

Returns the address of a const reference to T.

pointer allocate ( size_type  n,
const void *  = 0 
)
inline

Allocate and return n value_types of memory through this allocator. Requires that logog::Initialize() has been called.

void construct ( pointer  p,
const T &  val 
)
inline

Constructs a new T at location p with value val.

void deallocate ( void *  p,
size_type   
)
inline

Frees memory previously allocated by allocate().

void destroy ( pointer  p)
inline

Destroys a T at location p.

size_type max_size ( ) const
inline

The largest size of an object that can be allocated with this allocator.

Allocator<T>& operator= ( const Allocator< T > &  )
inline

STL required override for = operator.

Allocator& operator= ( const Allocator< U > &  )
inline

Permit this allocator to be used for assignment in other classes


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