STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

task_allocator Class Template Reference
[Allocator Library (COMSTL)]

STL Allocator based on the COM task allocator. More...

#include <comstl_task_allocator.h>

List of all members.

Public Types

typedef T value_type
 The value type.

typedef task_allocator< value_typeclass_type
 The type of the current parameterisation.

typedef value_typepointer
 The pointer type.

typedef value_type const * const_pointer
 The non-mutating (const) pointer type.

typedef value_typereference
 The reference type.

typedef value_type const & const_reference
 The non-mutating (const) reference type.

typedef ptrdiff_t difference_type
 The difference type.

typedef cs_size_t size_type
 The size type.

typedef pointer deallocate_pointer
 The type used in deallocate().


Public Methods

 task_allocator () comstl_throw_0()
 Default constructor.

template<typename U>  task_allocator (const task_allocator< U > &) comstl_throw_0()
 Copy constructor.

 ~task_allocator () comstl_throw_0()
 Destructor.

size_type max_size () const comstl_throw_0()
 Returns the maximum number of allocatable entities.

pointer address (reference x) const comstl_throw_0()
 Returns the address corresponding to the given reference.

const_pointer address (const_reference x) const comstl_throw_0()
 Returns the address corresponding to the given non-mutable (const) reference.

pointer allocate (size_type n, task_allocator< void >::const_pointer pv=NULL)
 Allocates a block of memory sufficient to store n elements of type value_type.

void deallocate (pointer p, size_type n)
 Deallocates a pointer.

void deallocate (pointer p)
 Deallocates a pointer.

void construct (pointer p, value_type const &x)
 In-place constructs an instance of the value_type, with the given value.

void construct (pointer p)
 In-place constructs an instance of the value_type.

void destroy (pointer p) comstl_throw_0()
 In-place destroys an instance.


Detailed Description

template<typename T>
class comstl::task_allocator< T >

STL Allocator based on the COM task allocator.

Parameters:
T  The value_type of the allocator


Member Typedef Documentation

typedef task_allocator<value_type> class_type
 

The type of the current parameterisation.

typedef value_type const* const_pointer
 

The non-mutating (const) pointer type.

typedef value_type const& const_reference
 

The non-mutating (const) reference type.

typedef pointer deallocate_pointer
 

The type used in deallocate().

typedef ptrdiff_t difference_type
 

The difference type.

typedef value_type* pointer
 

The pointer type.

typedef value_type& reference
 

The reference type.

typedef cs_size_t size_type
 

The size type.

typedef T value_type
 

The value type.


Constructor & Destructor Documentation

task_allocator   [inline]
 

Default constructor.

task_allocator const task_allocator< U > &    [inline]
 

Copy constructor.

~task_allocator   [inline]
 

Destructor.


Member Function Documentation

const_pointer address const_reference    x const [inline]
 

Returns the address corresponding to the given non-mutable (const) reference.

Parameters:
x  A non-mutable (const) reference to a value_type instance whose address will be calculated

pointer address reference    x const [inline]
 

Returns the address corresponding to the given reference.

Parameters:
x  A reference to a value_type instance whose address will be calculated

pointer allocate size_type    n,
task_allocator< void >::const_pointer    pv = NULL
[inline]
 

Allocates a block of memory sufficient to store n elements of type value_type.

Parameters:
n  The number of elements to allocate
pv  A hint to enhance localisation (not used in this class)
Returns:
The allocated block, or the null pointer (if the allocation fails and the translation does not support throwing exceptions upon memory exhaustion)

void construct pointer    p [inline]
 

In-place constructs an instance of the value_type.

Parameters:
p  The location in which to construct the instance

void construct pointer    p,
value_type const &    x
[inline]
 

In-place constructs an instance of the value_type, with the given value.

Parameters:
p  The location in which to construct the instance
x  The value with which to copy construct the instance

void deallocate pointer    p [inline]
 

Deallocates a pointer.

Parameters:
p  The memory block to deallocate

void deallocate pointer    p,
size_type    n
[inline]
 

Deallocates a pointer.

Parameters:
p  The memory block to deallocate
n  The number of blocks to deallocate

void destroy pointer    p [inline]
 

In-place destroys an instance.

Parameters:
p  The instance whose destructor is to be called

size_type max_size   const [inline]
 

Returns the maximum number of allocatable entities.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004