Gecode::space_allocator< void > Struct Reference

Space allocator - specialization for `void`. More...

`#include <allocators.hpp>`

## Classes

struct | rebind
| Rebinding helper (returns the type of a similar allocator for type U). More...

## Public Types

typedef void * | pointer
typedef const void * | const_pointer
typedef void | value_type
typedef size_t | size_type
| Type that can represent the size of the largest object.
typedef ptrdiff_t | difference_type
| Type that can represent the difference between any two pointers.
typedef void & | reference
| Non-const reference to T.
typedef void const & | const_reference
| Const reference to T.

## Public Member Functions

| space_allocator (Space &space) throw ()
| Construction.
space_allocator & | operator= (space_allocator const &al)
| Assignment operator.
pointer | address (reference x) const
| Convert a reference x to a pointer.
size_type | max_size (void) const throw ()
| Returns the largest size for which a call to allocate might succeed.
pointer | allocate (size_type count)
| Allocates storage.
void | deallocate (pointer p, size_type count)
| Deallocates the storage obtained by a call to allocate() with arguments count and p.
void | construct (pointer element, const_reference t)
void | destroy (pointer element)
| Calls the destructor on the object pointed to by element.

## Public Attributes

Space & | space
| The space that we allocate objects from.

## Detailed Description

Space allocator - specialization for `void`.

The specialization is needed as the default instantiation fails for `void`.

Definition at line 157 of file allocators.hpp.

## Member Typedef Documentation

## pointer

typedef void* Gecode::space_allocator< void >::pointer

Definition at line 158 of file allocators.hpp.

## const_pointer

typedef const void* Gecode::space_allocator< void >::const_pointer

Definition at line 159 of file allocators.hpp.

## value_type

typedef void Gecode::space_allocator< void >::value_type

Definition at line 160 of file allocators.hpp.

## size_type

typedef size_t Gecode::space_allocator< void >::size_type

Type that can represent the size of the largest object.

Definition at line 181 of file allocators.hpp.

## difference_type

typedef ptrdiff_t Gecode::space_allocator< void >::difference_type

Type that can represent the difference between any two pointers.

Definition at line 183 of file allocators.hpp.

## reference

typedef void& Gecode::space_allocator< void >::reference

Non-const reference to T.

Definition at line 189 of file allocators.hpp.

## const_reference

typedef void const& Gecode::space_allocator< void >::const_reference

Const reference to T.

Definition at line 191 of file allocators.hpp.

## Constructor & Destructor Documentation

## space_allocator()

Gecode::space_allocator< void >::space_allocator | ( | Space & | space | ) |
throw | ( | ) |  |  |

inline

Construction.

Parameters

  space | The space whose heap to allocate objects from.

Definition at line 205 of file allocators.hpp.

## Member Function Documentation

## operator=()

space_allocator & Gecode::space_allocator< void >::operator= | ( | space_allocator< void > const & | al | ) |

inline

Assignment operator.

Parameters

  al | The allocator to assign.

Definition at line 215 of file allocators.hpp.

## address()

pointer Gecode::space_allocator< void >::address | ( | reference | x | ) | const

inline

Convert a reference x to a pointer.

Definition at line 228 of file allocators.hpp.

## max_size()

size_type Gecode::space_allocator< void >::max_size | ( | void |  | ) | const
throw | ( | ) |  |  |

inline

Returns the largest size for which a call to allocate might succeed.

Definition at line 232 of file allocators.hpp.

## allocate()

pointer Gecode::space_allocator< void >::allocate | ( | size_type | count | ) |

inline

Allocates storage.

Returns a pointer to the first element in a block of storage count*sizeof(T) bytes in size. The block is aligned appropriately for objects of type T. Throws the exception bad_alloc if the storage is unavailable.

Definition at line 244 of file allocators.hpp.

## deallocate()

void Gecode::space_allocator< void >::deallocate | ( | pointer | p,
|  | size_type | count )

inline

Deallocates the storage obtained by a call to allocate() with arguments count and p.

Definition at line 264 of file allocators.hpp.

## construct()

void Gecode::space_allocator< void >::construct | ( | pointer | element,
|  | const_reference | t )

inline

Definition at line 275 of file allocators.hpp.

## destroy()

void Gecode::space_allocator< void >::destroy | ( | pointer | element | ) |

inline

Calls the destructor on the object pointed to by element.

Definition at line 280 of file allocators.hpp.

## Member Data Documentation

## space

Space& Gecode::space_allocator< void >::space

The space that we allocate objects from.

Definition at line 199 of file allocators.hpp.

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

- gecode/kernel/memory/allocators.hpp