Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

const_iterator Class

(QFuture::const_iterator)

TheQFuture::const_iterator class provides an STL-style const iterator forQFuture.More...

Header:#include <const_iterator>
Since: Qt 4.4

Note: All functions in this class arereentrant.

Public Types

typedefdifference_type
typedefiterator_category
typedefpointer
typedefreference
typedefvalue_type

Public Functions

const_iterator()
const_iterator(const const_iterator & other)
booloperator!=(const const_iterator & other) const
const T &operator*() const
const_iteratoroperator+(int j) const
const_iterator &operator++()
const_iteratoroperator++(int)
const_iterator &operator+=(int j)
const_iteratoroperator-(int j) const
const_iterator &operator--()
const_iteratoroperator--(int)
const_iterator &operator-=(int j)
const T *operator->() const
const_iterator &operator=(const const_iterator & other)
booloperator==(const const_iterator & other) const

Detailed Description

TheQFuture::const_iterator class provides an STL-style const iterator forQFuture.

QFuture provides bothSTL-style iterators andJava-style iterators. The STL-style iterators are more low-level and more cumbersome to use; on the other hand, they are slightly faster and, for developers who already know STL, have the advantage of familiarity.

The defaultQFuture::const_iterator constructor creates an uninitialized iterator. You must initialize it using aQFuture function likeQFuture::constBegin() orQFuture::constEnd() before you start iterating. Here's a typical loop that prints all the results available in a future:

QFuture<QString> future=...;QFuture<QString>::const_iterator i;for (i= future.constBegin(); i!= future.constEnd();++i)    cout<<*i<< endl;

See alsoQFutureIterator andQFuture.

Member Type Documentation

typedef const_iterator::difference_type

Typedef for ptrdiff_t. Provided for STL compatibility.

typedef const_iterator::iterator_category

Typedef for std::bidirectional_iterator_tag. Provided for STL compatibility.

typedef const_iterator::pointer

Typedef for const T *. Provided for STL compatibility.

typedef const_iterator::reference

Typedef for const T &. Provided for STL compatibility.

typedef const_iterator::value_type

Typedef for T. Provided for STL compatibility.

Member Function Documentation

const_iterator::const_iterator()

Constructs an uninitialized iterator.

Functions like operator*() and operator++() should not be called on an uninitialized iterartor. Use operator=() to assign a value to it before using it.

See alsoQFuture::constBegin() andQFuture::constEnd().

const_iterator::const_iterator(constconst_iterator & other)

Constructs a copy ofother.

bool const_iterator::operator!=(constconst_iterator & other) const

Returns true ifother points to a different result than this iterator; otherwise returns false.

See alsooperator==().

constT & const_iterator::operator*() const

Returns the current result.

const_iterator const_iterator::operator+(int j) const

Returns an iterator to the results atj positions forward from this iterator. (Ifj is negative, the iterator goes backward.)

See alsooperator-() andoperator+=().

const_iterator & const_iterator::operator++()

The prefix ++ operator (++it) advances the iterator to the next result in the future and returns an iterator to the new current result.

Calling this function onQFuture::constEnd() leads to undefined results.

See alsooperator--().

const_iterator const_iterator::operator++(int)

This is an overloaded function.

The postfix ++ operator (it++) advances the iterator to the next result in the future and returns an iterator to the previously current result.

const_iterator & const_iterator::operator+=(int j)

Advances the iterator byj results. (Ifj is negative, the iterator goes backward.)

See alsooperator-=() andoperator+().

const_iterator const_iterator::operator-(int j) const

Returns an iterator to the result atj positions backward from this iterator. (Ifj is negative, the iterator goes forward.)

See alsooperator+() andoperator-=().

const_iterator & const_iterator::operator--()

The prefix -- operator (--it) makes the preceding result current and returns an iterator to the new current result.

Calling this function onQFuture::constBegin() leads to undefined results.

See alsooperator++().

const_iterator const_iterator::operator--(int)

This is an overloaded function.

The postfix -- operator (it--) makes the preceding result current and returns an iterator to the previously current result.

const_iterator & const_iterator::operator-=(int j)

Makes the iterator go back byj results. (Ifj is negative, the iterator goes forward.)

See alsooperator+=() andoperator-().

constT * const_iterator::operator->() const

Returns a pointer to the current result.

const_iterator & const_iterator::operator=(constconst_iterator & other)

Assignsother to this iterator.

bool const_iterator::operator==(constconst_iterator & other) const

Returns true ifother points to the same result as this iterator; otherwise returns false.

See alsooperator!=().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp