# Poco::Dynamic

# class VarIterator

Library: Foundation
Package: Dynamic
Header: Poco/Dynamic/VarIterator.h

## Description

VarIterator class.

## Member Summary

Member Functions: operator !=, operator *, operator +, operator ++, operator -, operator --, operator <, operator <=, operator =, operator ==, operator >, operator >=, operator->, swap

## Types Aliases

### difference_type

using difference_type = std::ptrdiff_t;

### iterator_category

using iterator_category = std::bidirectional_iterator_tag;

### pointer

using pointer = Var *;

### reference

using reference = Var &;

### value_type

using value_type = Var;

## Constructors

### VarIterator

VarIterator(
const VarIterator & other
);

Creates a copy of other VarIterator.

### VarIterator

VarIterator(
VarIterator && other
) noexcept;

Moves another VarIterator.

### VarIterator

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.

## Destructor

### ~VarIterator

~VarIterator();

Destroys the VarIterator.

## Member Functions

### operator !=

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

Inequality operator.

### operator *

Var & operator * () const;

Returns value at the current position.

### operator +

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

Returns a copy the VarIterator advanced by diff positions.

### operator ++

const VarIterator & operator ++ () const;

Advances by one position and returns current position.

### operator ++

VarIterator operator ++ (
int
) const;

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

### operator -

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.

### operator --

const VarIterator & operator -- () const;

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

### operator --

VarIterator operator -- (
int
) const;

Goes back by one position and returns previous current position.

### operator <

bool operator < (
const VarIterator & other
) const;

Less than operator.

### operator <=

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

Less than or equal to operator.

### operator =

VarIterator & operator = (
const VarIterator & other
);

Assigns the other VarIterator.

### operator =

VarIterator & operator = (
VarIterator && other
) noexcept;

Assigns the other VarIterator.

### operator ==

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

Equality operator.

### operator >

bool operator > (
const VarIterator & other
) const;

Greater than operator.

### operator >=

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

Greater than or equal to operator.

### operator->

Var * operator-> () const;

Returns pointer to the value at current position.

### swap

void swap(
VarIterator & other
);

Swaps the VarIterator with another one.

## Variables

### POSITION_END

static const std::size_t POSITION_END;

End position indicator.