Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QIterable< Container > Class Template Reference

\inmodule QtCore More...

#include <qiterable.h>

Collaboration diagram for QIterable< Container >:

Public Member Functions

template<class T>
 QIterable (const Container &metaContainer, const T *p)
template<class T>
 QIterable (const Container &metaContainer, T *p)
template<typename Pointer>
 QIterable (const Container &metaContainer, Pointer iterable)
 QIterable (const Container &metaContainer, qsizetype alignment, const void *p)
 QIterable (const Container &metaContainer, qsizetype alignment, void *p)
bool canInputIterate () const
 Returns whether the container has an input iterator.
bool canForwardIterate () const
 Returns whether it is possible to iterate over the container in forward direction.
bool canReverseIterate () const
 Returns whether it is possible to iterate over the container in reverse.
bool canRandomAccessIterate () const
 Returns whether it is possible to efficiently skip over multiple values using and iterator.
const voidconstIterable () const
voidmutableIterable ()
QConstIterator< Container > constBegin () const
 Returns a QConstIterator for the beginning of the container.
QConstIterator< Container > constEnd () const
 Returns a Qterable::QConstIterator for the end of the container.
QIterator< Container > mutableBegin ()
 Returns a QIterator for the beginning of the container.
QIterator< Container > mutableEnd ()
 Returns a QMetaSequence::Iterable::iterator for the end of the container.
qsizetype size () const
 Returns the number of values in the container.
void clear ()
 Clears the container.
Container metaContainer () const

Protected Attributes

uint m_revision = 0
QtPrivate::QConstPreservingPointer< void, quint16m_iterable
Container m_metaContainer

Friends

class QBaseIterator< Container >

Detailed Description

template<class Container>
class QIterable< Container >

\inmodule QtCore

Since
6.0

QIterable is a template class that is the base class for QMetaSequence::Iterable and QMetaAssociation::Iterable.

QIterable<Container> provides a common interface for iterating over containers through QVariant, where Container is the meta-type descriptor (either QMetaSequence or QMetaAssociation) that defines the container's iteration capabilities.

Definition at line 418 of file qiterable.h.

Constructor & Destructor Documentation

◆ QIterable() [1/5]

template<class Container>
template<class T>
QIterable< Container >::QIterable ( const Container & metaContainer,
const T * p )
inline

Definition at line 429 of file qiterable.h.

References QIterable(), and m_metaContainer.

Referenced by QIterable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QIterable() [2/5]

template<class Container>
template<class T>
QIterable< Container >::QIterable ( const Container & metaContainer,
T * p )
inline

Definition at line 435 of file qiterable.h.

References QIterable(), and m_metaContainer.

Referenced by QIterable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QIterable() [3/5]

template<class Container>
template<typename Pointer>
QIterable< Container >::QIterable ( const Container & metaContainer,
Pointer iterable )
inline

Definition at line 441 of file qiterable.h.

References QIterable(), and m_metaContainer.

Referenced by QIterable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QIterable() [4/5]

template<class Container>
QIterable< Container >::QIterable ( const Container & metaContainer,
qsizetype alignment,
const void * p )
inline

Definition at line 446 of file qiterable.h.

References QIterable(), and m_metaContainer.

Referenced by QIterable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QIterable() [5/5]

template<class Container>
QIterable< Container >::QIterable ( const Container & metaContainer,
qsizetype alignment,
void * p )
inline

Definition at line 451 of file qiterable.h.

References QIterable(), and m_metaContainer.

Referenced by QIterable().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ canForwardIterate()

template<class Container>
bool QIterable< Container >::canForwardIterate ( ) const
inline

Returns whether it is possible to iterate over the container in forward direction.

This corresponds to the std::forward_iterator_tag iterator trait of the iterator and const_iterator of the container.

Definition at line 461 of file qiterable.h.

References m_metaContainer.

◆ canInputIterate()

template<class Container>
bool QIterable< Container >::canInputIterate ( ) const
inline

Returns whether the container has an input iterator.

This corresponds to the std::input_iterator_tag iterator trait of the iterator and const_iterator of the container.

Definition at line 456 of file qiterable.h.

References m_metaContainer.

◆ canRandomAccessIterate()

template<class Container>
bool QIterable< Container >::canRandomAccessIterate ( ) const
inline

Returns whether it is possible to efficiently skip over multiple values using and iterator.

This corresponds to the std::random_access_iterator_tag iterator trait of the iterator and const_iterator of the container.

Definition at line 471 of file qiterable.h.

References m_metaContainer.

◆ canReverseIterate()

template<class Container>
bool QIterable< Container >::canReverseIterate ( ) const
inline

Returns whether it is possible to iterate over the container in reverse.

This corresponds to the std::bidirectional_iterator_tag iterator trait of the const_iterator of the container.

Definition at line 466 of file qiterable.h.

References m_metaContainer.

◆ clear()

template<class Container>
void QIterable< Container >::clear ( )
inline

Clears the container.

Definition at line 524 of file qiterable.h.

References m_metaContainer, and mutableIterable().

Here is the call graph for this function:

◆ constBegin()

template<class Container>
QConstIterator< Container > QIterable< Container >::constBegin ( ) const
inline

Returns a QConstIterator for the beginning of the container.

This can be used in stl-style iteration.

See also
constEnd(), mutableBegin()

Definition at line 479 of file qiterable.h.

References constIterable(), and m_metaContainer.

Here is the call graph for this function:

◆ constEnd()

template<class Container>
QConstIterator< Container > QIterable< Container >::constEnd ( ) const
inline

Returns a Qterable::QConstIterator for the end of the container.

This can be used in stl-style iteration.

See also
constBegin(), mutableEnd()

Definition at line 484 of file qiterable.h.

References constIterable(), and m_metaContainer.

Here is the call graph for this function:

◆ constIterable()

template<class Container>
const void * QIterable< Container >::constIterable ( ) const
inline

Definition at line 476 of file qiterable.h.

Referenced by constBegin(), constEnd(), and size().

Here is the caller graph for this function:

◆ metaContainer()

template<class Container>
Container QIterable< Container >::metaContainer ( ) const
inline

Definition at line 529 of file qiterable.h.

References m_metaContainer.

◆ mutableBegin()

template<class Container>
QIterator< Container > QIterable< Container >::mutableBegin ( )
inline

Returns a QIterator for the beginning of the container.

This can be used in stl-style iteration.

See also
mutableEnd(), constBegin()

Definition at line 489 of file qiterable.h.

References m_metaContainer, and mutableIterable().

Here is the call graph for this function:

◆ mutableEnd()

template<class Container>
QIterator< Container > QIterable< Container >::mutableEnd ( )
inline

Returns a QMetaSequence::Iterable::iterator for the end of the container.

This can be used in stl-style iteration.

See also
mutableBegin(), constEnd()

Definition at line 494 of file qiterable.h.

References m_metaContainer, and mutableIterable().

Here is the call graph for this function:

◆ mutableIterable()

template<class Container>
void * QIterable< Container >::mutableIterable ( )
inline

Definition at line 477 of file qiterable.h.

Referenced by clear(), mutableBegin(), and mutableEnd().

Here is the caller graph for this function:

◆ size()

template<class Container>
qsizetype QIterable< Container >::size ( ) const
inline

Returns the number of values in the container.

Note
If the underlying container does not provide a native way to query the size, this method will synthesize the access using iterators. This behavior is deprecated and will be removed in a future version of Qt.

Definition at line 499 of file qiterable.h.

References constIterable(), QtPrivate::IterableSize, m_metaContainer, and QtPrivate::warnSynthesizedIterableAccess().

Here is the call graph for this function:

◆ QBaseIterator< Container >

template<class Container>
friend class QBaseIterator< Container >
friend

Definition at line 411 of file qiterable.h.

Member Data Documentation

◆ m_iterable

template<class Container>
QtPrivate::QConstPreservingPointer<void, quint16> QIterable< Container >::m_iterable
protected

Definition at line 424 of file qiterable.h.

◆ m_metaContainer

template<class Container>
Container QIterable< Container >::m_metaContainer
protected

◆ m_revision

template<class Container>
uint QIterable< Container >::m_revision = 0
protected

Definition at line 423 of file qiterable.h.


The documentation for this class was generated from the following files: