class Poco::Dynamic::VarIterator

Overview

VarIterator class. Moreā€¦

#include <VarIterator.h>

class VarIterator
{
public:
    // typedefs

    typedef std::bidirectional_iterator_tag iterator_category;
    typedef Var value_type;
    typedef std::ptrdiff_t difference_type;
    typedef Var* pointer;
    typedef Var& reference;

    // fields

    static const std::size_t POSITION_END;

    // construction

    VarIterator(
        Var* pVar,
        bool positionEnd
        );

    VarIterator(const VarIterator& other);

    // methods

    VarIterator&
    operator=(const VarIterator& other);

    bool
    operator==(const VarIterator& other) const;

    bool
    operator!=(const VarIterator& other) const;

    Var&
    operator*() const;

    Var*
    operator->() const;

    const VarIterator&
    operator++() const;

    VarIterator
    operator++(int) const;

    const VarIterator&
    operator--() const;

    VarIterator
    operator--(int) const;

    VarIterator
    operator+(std::size_t diff) const;

    VarIterator
    operator-(std::size_t diff) const;

    void
    swap(VarIterator& other);
};

Detailed Documentation

VarIterator class.

Fields

static const std::size_t POSITION_END

End position indicator.

Construction

VarIterator(
    Var* pVar,
    bool positionEnd
    )

Creates the VarIterator and positions it at the end of the recordset if positionEnd is true.

Otherwise, it is positioned at the beginning.

VarIterator(const VarIterator& other)

Creates a copy of other VarIterator.

Methods

VarIterator&
operator=(const VarIterator& other)

Assigns the other VarIterator.

bool
operator==(const VarIterator& other) const

Equality operator.

bool
operator!=(const VarIterator& other) const

Inequality operator.

Var&
operator*() const

Returns value at the current position.

Var*
operator->() const

Returns pointer to the value at current position.

const VarIterator&
operator++() const

Advances by one position and returns current position.

VarIterator
operator++(int) const

Advances by one position and returns copy of the iterator with previous current position.

const VarIterator&
operator--() const

Goes back by one position and returns copy of the iterator with previous current position.

VarIterator
operator--(int) const

Goes back by one position and returns previous current position.

VarIterator
operator+(std::size_t diff) const

Returns a copy the VarIterator advanced by diff positions.

VarIterator
operator-(std::size_t diff) const

Returns a copy the VarIterator backed by diff positions.

Throws RangeException if diff is larger than current position.

void
swap(VarIterator& other)

Swaps the VarIterator with another one.