# Spec JournaledSet
A StringSet storing the strings as members. It can store a global reference sequence to which all members can be journaled if they are of type JournaledString.

Extends | StringSet
All Extended | StringSet
All Impl'd | AssignableConcept, ContainerConcept, DestructibleConcept, ForwardContainerConcept, RandomAccessContainerConcept, ReversibleContainerConcept, SegmentableConcept, StringConcept, TextConcept
Defined in | <seqan/journaled_set.h>
Signature | `template <typename TString> class StringSet<TString, Owner<JournaledSet> >;`

## Template Parameters

`TString` | The string type. Types: String, JournaledString

## Member Function Overview

### Member Functions Inherited From AssignableConcept

- `operator=`

### Member Functions Inherited From RandomAccessContainerConcept

- `operator[]`

## Interface Function Overview

- `void createHost(stringSet, ref);`
  Creates the global reference of a JournaledSet.
- `THost host(stringSet);`
  Returns the global reference sequence of a JournaledSet.
- `void join(stringSet, pos, joinConfig);`
  Joins a JournaledString to a JournaledSet by computing and journaling differences to the global reference sequence.
- `void setHost(stringSet, ref);`
  Sets the global reference of a JournaledSet.

### Interface Functions Inherited From StringSet

- `assignValue`
- `assignValueById`
- `clear`
- `concat`
- `getValueById`
- `idToPosition`
- `lengthSum`
- `positionToId`
- `removeValueById`
- `reserve`
- `strSplit`
- `valueById`

### Interface Functions Inherited From AssignableConcept

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

### Interface Functions Inherited From ContainerConcept

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

### Interface Functions Inherited From RandomAccessContainerConcept

- `value`
- `assignValue`
- `getValue`

### Interface Functions Inherited From SegmentableConcept

- `prefix`
- `infixWithLength`
- `infix`
- `suffix`

### Interface Functions Inherited From StringConcept

- `iter`
- `append`
- `appendValue`
- `front`
- `back`
- `resize`
- `clear`
- `erase`
- `eraseFront`
- `eraseBack`
- `capacity`
- `computeGenerousCapacity`
- `insert`
- `insertValue`
- `replace`

### Interface Functions Inherited From TextConcept

- `stringSetLimits`
- `posLocalToX`
- `posLocalize`
- `posGlobalize`
- `getSeqNo`
- `getSeqOffset`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From StringSet

- `Concatenator`
- `GetSequenceByNo`
- `Id`
- `LengthSum`
- `StringSetPosition`

### Interface Metafunctions Inherited From ContainerConcept

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

### Interface Metafunctions Inherited From SegmentableConcept

- `Infix`
- `Prefix`
- `Suffix`

### Interface Metafunctions Inherited From TextConcept

- `SAValue`
- `StringSetLimits`

## Detailed Description

The strings are internally stored in a `String<TString>` object and the character position type is a Pair `(seqNo, seqOfs)` where seqNo identifies the string within the string set and seqOfs identifies the position within this string.

The global reference is of type `Host<TString>`. Only strings of type JournaledString or `Host<`JournaledString`>` can be used for the advanced functionality supported by this string set.

## Interface Functions Detail

### `void createHost(stringSet, ref);`

Creates the global reference of a JournaledSet.

#### Parameters

`stringSet` | The JournaledStringSet that stores the sequences.
`ref` | The new reference sequence of the JournaledSet. Stores a copy of the passed global reference sequence.

#### Data Races

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

### `THost host(stringSet);`

Returns the global reference sequence of a JournaledSet.

#### Parameters

`stringSet` | The JournaledStringSet that stores the sequences. Types: JournaledSet

#### Returns

`THost` | Reference to the host.

#### Data Races

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

### `void join(stringSet, pos, joinConfig);`

Joins a JournaledString to a JournaledSet by computing and journaling differences to the global reference sequence.

#### Parameters

`stringSet` | The JournaledSet to join to.
`pos` | The position of the JournaledString within the string set.
`joinConfig` | A JoinConfig object that specifies the method and the method's strategy to compute the differences.

#### Data Races

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

### `void setHost(stringSet, ref);`

Sets the global reference of a JournaledSet.

#### Parameters

`stringSet` | The string set that stores the sequences. Types: JournaledSet
`ref` | The new reference sequence of the JournaledSet.

#### Remarks

Uses an Holder to store a reference to the new global reference sequence instead of copying it.

#### Data Races

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

#### Dox Sources

    /*!
     * @class JournaledSet
     *
     * @extends StringSet
     *
     * @headerfile <seqan/journaled_set.h>
     *
     * @brief A @link StringSet @endlink storing the strings as members. It can
     *        store a global reference sequence to which all members can be
     *        journaled if they are of type @link JournaledString @endlink.
     *
     * @signature template <typename TString> class StringSet<TString,
     *            Owner<JournaledSet> >;
     *
     * @tparam TString The string type. Types: @link String @endlink, @link
     *                 JournaledString @endlink
     *
     * The strings are internally stored in a <tt>String&lt;TString&gt;</tt> object
     * and the character position type is a @link Pair @endlink <tt>(seqNo,
     * seqOfs)</tt> where seqNo identifies the string within the string set and
     * seqOfs identifies the position within this string.
     *
     * The global reference is of type <tt>Host&lt;TString&gt;</tt>. Only strings of
     * type @link JournaledString @endlink or <tt>Host&lt;</tt>@link JournaledString
     * @endlink<tt>&gt;</tt> can be used for the advanced functionality supported by
     * this string set.
     *
     * @fn JournaledSet#host
     *
     * @brief Returns the global reference sequence of a @link JournaledSet
     *        @endlink.
     *
     * @signature THost host(stringSet);
     *
     * @param[in] stringSet The JournaledStringSet that stores the sequences. Types:
     *                      @link JournaledSet @endlink
     *
     * @return THost Reference to the host.
     *
     * @fn JournaledSet#setHost
     *
     * @brief Sets the global reference of a @link JournaledSet @endlink.
     *
     * @signature void setHost(stringSet, ref);
     *
     * @param[in,out] stringSet The string set that stores the sequences. Types:
     *                          @link JournaledSet @endlink
     * @param[in] ref The new reference sequence of the @link JournaledSet @endlink.
     *
     * @section Remarks
     *
     * Uses an @link Holder @endlink to store a reference to the new global
     * reference sequence instead of copying it.
     *
     * @fn JournaledSet#createHost
     *
     * @brief Creates the global reference of a @link JournaledSet @endlink.
     *
     * @signature void createHost(stringSet, ref);
     *
     * @param[in,out] stringSet The JournaledStringSet that stores the sequences.
     * @param[in] ref The new reference sequence of the JournaledSet. Stores a copy
     *                of the passed global reference sequence.
     *
     * @fn JournaledSet#join
     *
     * @brief Joins a @link JournaledString @endlink to a @link JournaledSet
     *        @endlink by computing and journaling differences to the global
     *        reference sequence.
     *
     * @signature void join(stringSet, pos, joinConfig);
     *
     * @param[in,out] stringSet The JournaledSet to join to.
     * @param[in] pos The position of the JournaledString within the string set.
     * @param[in] joinConfig A @link JoinConfig @endlink object that specifies the
     *                       method and the method's strategy to compute the
     *                       differences.
     */