ToStdAllocator - SeqAn API Documentation

# Class ToStdAllocator
Emulates standard conform allocator.

Defined in | <seqan/basic.h>
Signature | `template <typename THost, typename TValue> class ToStdAllocator;`

## Template Parameters

`TValue` | Type of allocated items.
`THost` | Type of the host allocator object.This object is used to call allocate and deallocate.

## Interface Function Overview

- `THost host(allocator);`
  The object a given object depends on.
- `ToStdAllocator::ToStdAllocator(host);`
  Constructor

## Detailed Description

The member functions `allocate` and `deallocate` of `ToStdAllocator` call the (globale) functions allocate and deallocate, respectively. The globale functions get an allocator object as their first arguments. This allocator object is not the `ToStdAllocator` object itself, but the host object that was given to the constructor.

## Interface Functions Detail

### `THost host(allocator);`

The object a given object depends on.

#### Parameters

`allocator` | The allocator to query.

#### Returns

`THost` | The host object.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `ToStdAllocator::ToStdAllocator(host);`

Constructor

#### Parameters

`host` | The host object that is used as allocator for allocate and deallocate.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### Dox Sources

    /*!
     * @class ToStdAllocator
     *
     * @headerfile <seqan/basic.h>
     *
     * @brief Emulates standard conform allocator.
     *
     * @signature template <typename THost, typename TValue> class ToStdAllocator;
     *
     * @tparam TValue Type of allocated items.
     * @tparam THost Type of the host allocator object.This object is used to call
     *               @link Allocator#allocate @endlink and @link
     *               Allocator#deallocate @endlink.
     *
     * The member functions <tt>allocate</tt> and <tt>deallocate</tt> of
     * <tt>ToStdAllocator</tt> call the (globale) functions @link Allocator#allocate
     * @endlink and @link Allocator#deallocate @endlink, respectively. The globale
     * functions get an allocator object as their first arguments. This allocator
     * object is not the <tt>ToStdAllocator</tt> object itself, but the host object
     * that was given to the constructor.
     *
     * @fn ToStdAllocator#ToStdAllocator
     *
     * @brief Constructor
     *
     * @signature ToStdAllocator::ToStdAllocator(host);
     *
     * @param[in] host The host object that is used as allocator for @link
     *                 Allocator#allocate @endlink and @link Allocator#deallocate
     *                 @endlink.
     *
     * @fn ToStdAllocator#host
     *
     * @headerfile <seqan/basic.h>
     *
     * @brief The object a given object depends on.
     *
     * @signature THost host(allocator);
     *
     * @param[in] allocator The allocator to query.
     *
     * @return THost The host object.
     */