Generated on for Gecode by doxygen 1.15.0
Gecode::region_allocator< void > Struct Reference

Region allocator - specialization for void. More...

#include <gecode/kernel/memory/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

 region_allocator (Region &region) noexcept
 Construction.
pointer address (reference x) const
 Convert a reference x to a pointer.
size_type max_size (void) const noexcept
 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 storage.
void construct (pointer element, const_reference t)
 Constructs an object.
void destroy (pointer element)
 Calls the destructor on the object pointed to by element.

Public Attributes

Region & region
 The region that we allocate objects from.

Detailed Description

Region allocator - specialization for void.

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

Definition at line 319 of file allocators.hpp.

Member Typedef Documentation

◆ pointer

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

Definition at line 320 of file allocators.hpp.

◆ const_pointer

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

Definition at line 321 of file allocators.hpp.

◆ value_type

typedef void Gecode::region_allocator< void >::value_type

Definition at line 322 of file allocators.hpp.

◆ size_type

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

Type that can represent the size of the largest object.

Definition at line 342 of file allocators.hpp.

◆ difference_type

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

Type that can represent the difference between any two pointers.

Definition at line 344 of file allocators.hpp.

◆ reference

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

Non-const reference to T.

Definition at line 350 of file allocators.hpp.

◆ const_reference

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

Const reference to T.

Definition at line 352 of file allocators.hpp.

Constructor & Destructor Documentation

◆ region_allocator()

Gecode::region_allocator< void >::region_allocator ( Region & region)
inlinenoexcept

Construction.

Parameters
regionThe region to allocate objects from.

Definition at line 367 of file allocators.hpp.

Member Function Documentation

◆ address()

pointer Gecode::region_allocator< void >::address ( reference x) const
inline

Convert a reference x to a pointer.

Definition at line 384 of file allocators.hpp.

◆ max_size()

size_type Gecode::region_allocator< void >::max_size ( void ) const
inlinenoexcept

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

Definition at line 388 of file allocators.hpp.

◆ allocate()

pointer Gecode::region_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 401 of file allocators.hpp.

◆ deallocate()

void Gecode::region_allocator< void >::deallocate ( pointer p,
size_type count )
inline

Deallocates storage.

Deallocates storage obtained by a call to allocate() with arguments count and p. Note that region allocator never actually deallocates memory (so this function does nothing); the memory is released when the region is destroyed.

Definition at line 429 of file allocators.hpp.

◆ construct()

void Gecode::region_allocator< void >::construct ( pointer element,
const_reference t )
inline

Constructs an object.

Constructs an object of type T with the initial value of t at the location specified by element. This function calls the placement new() operator.

Definition at line 440 of file allocators.hpp.

◆ destroy()

void Gecode::region_allocator< void >::destroy ( pointer element)
inline

Calls the destructor on the object pointed to by element.

Definition at line 445 of file allocators.hpp.

Member Data Documentation

◆ region

Region& Gecode::region_allocator< void >::region

The region that we allocate objects from.

Definition at line 361 of file allocators.hpp.


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