RandomAccessContainerConcept - SeqAn API Documentation

# Concept RandomAccessContainerConcept
A random access container is a reversible container whose iterator is a random access iterator.

Extends | ReversibleContainerConcept
All Extended | AssignableConcept, ContainerConcept, DestructibleConcept, ForwardContainerConcept, ReversibleContainerConcept
All Subcl's | StringConcept
Defined in | <seqan/basic.h>
Signature | `RandomAccessContainerConcept<T>`

## Detailed Description

Random access containers support amortized constant time access to its elements.

## Member Function Overview

- `TReference T::operator[](pos);`
  Returns a reference to an arbitrary element in the sequence.

### Member Functions Inherited From AssignableConcept

- `operator=`

## Interface Function Overview

- `void assignValue(cont, pos, val);`
  Assign value in RandomAccessContainer.
- `TGetValue getValue(seq, pos);`
  Get-value retrieval from container.
- `TReference value(seq, pos);`
  Global function variant of subscript operator.

### Interface Functions Inherited From AssignableConcept

- `assign`
- `move`
- `set`

### Interface Functions Inherited From ContainerConcept

- `append`
- `appendValue`
- `begin`
- `directionIterator`
- `empty`
- `end`
- `getObjectId`
- `length`
- `moveValue`
- `shrinkToFit`
- `swap`
- `write`
- `writeValue`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From ContainerConcept

- `DefaultGetIteratorSpec`
- `DefaultIteratorSpec`
- `Difference`
- `DirectionIterator`
- `GetValue`
- `Iterator`
- `Position`
- `Reference`
- `Size`
- `Value`

## Member Functions Detail

### `TReference T::operator[](pos);`

Returns a reference to an arbitrary element in the sequence.

#### Parameters

`pos` | Position in the sequence (convertible to position type).

#### Returns

`TReference` | A reference to into the container with position `pos`.

#### Data Races

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

## Interface Functions Detail

### `void assignValue(cont, pos, val);`

Assign value in RandomAccessContainer.

#### Parameters

`seq` | The RandomAccessContainer to modify.
`pos` | The position to modify value at.
`val` | The value to assign to the given position.

#### Data Races

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

### `TGetValue getValue(seq, pos);`

Deprecated.

Use the subscript operator (`operator[]`) instead.

Get-value retrieval from container.

#### Parameters

`seq` | The sequence to get value in.
`pos` | Position in the sequence (convertible to position type).

#### Returns

`TGetValue` | The get-value (type is GetValue of the sequence type).

#### Data Races

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

### `TReference value(seq, pos);`

Deprecated.

Use the subscript operator (`operator[]`) instead.

Global function variant of subscript operator.

#### Parameters

`seq` | The sequence to get value in.
`pos` | Position in the sequence (convertible to position type).

#### Returns

`TReference` | A reference to into the container with position `pos`.

#### Data Races

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

#### Dox Sources

    /*!
     * @concept RandomAccessContainerConcept
     *
     * @headerfile <seqan/basic.h>
     *
     * @extends ReversibleContainerConcept
     *
     * @brief A random access container is a reversible container whose iterator is
     *        a random access iterator.
     *
     * @signature RandomAccessContainerConcept<T>
     *
     * Random access containers support amortized constant time access to its
     * elements.
     *
     * @fn RandomAccessContainerConcept::operator[]
     *
     * @brief Returns a reference to an arbitrary element in the sequence.
     *
     * @signature TReference T::operator[](pos);
     *
     * @param[in] pos Position in the sequence (convertible to @link
     *                ContainerConcept#Position position @endlink type).
     *
     * @return TReference A reference to into the container with position
     *                    <tt>pos</tt>.
     *
     * @fn RandomAccessContainerConcept#value
     *
     * @brief Global function variant of subscript operator.
     *
     * @deprecated Use the subscript operator (<tt>operator[]</tt>) instead.
     *
     * @signature TReference value(seq, pos);
     *
     * @param[in] seq The sequence to get value in.
     * @param[in] pos Position in the sequence (convertible to @link
     *                ContainerConcept#Position position @endlink type).
     *
     * @return TReference A reference to into the container with position
     *                    <tt>pos</tt>.
     *
     * @fn RandomAccessContainerConcept#assignValue
     *
     * @brief Assign value in RandomAccessContainer.
     *
     * @signature void assignValue(cont, pos, val);
     *
     * @param[in,out] seq The RandomAccessContainer to modify.
     * @param[in] pos The position to modify value at.
     * @param[in] val The value to assign to the given position.
     *
     * @fn RandomAccessContainerConcept#getValue
     *
     * @brief Get-value retrieval from container.
     *
     * @deprecated Use the subscript operator (<tt>operator[]</tt>) instead.
     *
     * @signature TGetValue getValue(seq, pos);
     *
     * @param[in] seq The sequence to get value in.
     * @param[in] pos Position in the sequence (convertible to @link
     *                ContainerConcept#Position position @endlink type).
     *
     * @return TGetValue The get-value (type is @link ContainerConcept#GetValue
     *                   @endlink of the sequence type).
     */