Bottom-Up Iteration - SeqAn API Documentation

# Group Bottom-Up Iteration
Tag that specifies a VSTreeIterator to traverse the virtual string tree from the root towards the leafs.

## Grouped Tags Overview

- `Postorder`
  Post-order traversal of the virtual string tree.

## Grouped Function Overview

- `bool atEnd(iterator);`
  Determines whether an virtual string tree iterator is at the end position.

## Detailed Description

### Examples

The following example shows how the BottomUp tag is used.

    #include <seqan/index.h>

    using namespace seqan2;

    int main()
    {
        typedef Index<CharString> TIndex;
        TIndex index("TATAA");

        Iterator<TIndex, BottomUp<Postorder> >::Type itDefault;
        itDefault = begin(index, BottomUp<Postorder>());

        while (!isRoot(itDefault))
        {
            std::cout << representative(itDefault) << std::endl;
            goNext(itDefault);
        }

        return 0;
    }

Demo: demos/dox/index/begin_atEnd_representative_bottomUp.cpp

    AA
    ATAA
    A
    TAA
    TATAA
    TA

## Grouped Tags Detail

### `Postorder`

Post-order traversal of the virtual string tree.

## Grouped Functions Detail

### `bool atEnd(iterator);`

Defined in
  <seqan/index.h>

Determines whether an virtual string tree iterator is at the end position.

#### Parameters

`iterator` | An iterator.

#### Returns

`bool` | `true` if `iterator` points behind the last item of the container, otherwise `false`.

#### Examples

The following example shows the usage of the atEnd function.

    #include <seqan/index.h>

    using namespace seqan2;

    int main()
    {
        typedef Index<CharString> TIndex;
        TIndex index("TATAA");

        Iterator<TIndex, TopDown<ParentLinks<> > >::Type itDefault;
        itDefault = begin(index, TopDown<ParentLinks<> >());

        while (!atEnd(itDefault))
        {
            std::cout << representative(itDefault) << std::endl;
            goNext(itDefault);
        }

        std::cout << "--------------------------------" << std::endl;

        Iterator<TIndex, TopDown<ParentLinks<Postorder> > >::Type itPostOrder;
        itPostOrder = begin(index, TopDown<ParentLinks<Postorder> >());

        while (!atEnd(itPostOrder))
        {
            std::cout << representative(itPostOrder) << std::endl;
            goNext(itPostOrder);
        }

        return 0;
    }

Demo: demos/dox/index/begin_atEnd_representative.cpp

#### Data Races

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

#### Dox Sources

    /*!
     * @defgroup BottomUp Bottom-Up Iteration
     *
     * @brief Tag that specifies a @link VSTreeIterator @endlink to traverse the
     *        virtual string tree from the root towards the leafs.
     *
     * @section Examples
     *
     * The following example shows how the @link BottomUp @endlink tag is used.
     *
     * @include demos/dox/index/begin_atEnd_representative_bottomUp.cpp
     *
     * @code{.txt}
     * AA
     * ATAA
     * A
     * TAA
     * TATAA
     * TA
     * @endcode
     *
     *
     * @tag BottomUp#Postorder
     *
     * @brief Post-order traversal of the virtual string tree.
     *
     * @fn BottomUp#atEnd
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Determines whether an virtual string tree iterator is at the end
     *        position.
     *
     * @signature bool atEnd(iterator);
     *
     * @param[in] iterator An iterator.
     *
     * @return bool <tt>true</tt> if <tt>iterator</tt> points behind the last item
     *              of the container, otherwise <tt>false</tt>.
     *
     * @section Examples
     *
     * The following example shows the usage of the @link BottomUp#atEnd @endlink
     * function.
     *
     * @include demos/dox/index/begin_atEnd_representative.cpp
     */