Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMetaContainer Class Reference

#include <qmetacontainer.h>

+ Inheritance diagram for QMetaContainer:
+ Collaboration diagram for QMetaContainer:

Public Member Functions

 QMetaContainer ()=default
 
 QMetaContainer (const QtMetaContainerPrivate::QMetaContainerInterface *d)
 
bool hasInputIterator () const
 Returns true if the underlying container provides at least an input iterator as defined by std::input_iterator_tag, otherwise returns false.
 
bool hasForwardIterator () const
 Returns true if the underlying container provides at least a forward iterator as defined by std::forward_iterator_tag, otherwise returns false.
 
bool hasBidirectionalIterator () const
 Returns true if the underlying container provides a bi-directional iterator or a random access iterator as defined by std::bidirectional_iterator_tag and std::random_access_iterator_tag, respectively.
 
bool hasRandomAccessIterator () const
 Returns true if the underlying container provides a random access iterator as defined by std::random_access_iterator_tag, otherwise returns false.
 
bool hasSize () const
 Returns true if the container can be queried for its size, false otherwise.
 
qsizetype size (const void *container) const
 Returns the number of values in the given container if it can be queried for its size.
 
bool canClear () const
 Returns true if the container can be cleared, false otherwise.
 
void clear (void *container) const
 Clears the given container if it can be cleared.
 
bool hasIterator () const
 Returns true if the underlying container offers a non-const iterator, false otherwise.
 
voidbegin (void *container) const
 Creates and returns a non-const iterator pointing to the beginning of container.
 
voidend (void *container) const
 Creates and returns a non-const iterator pointing to the end of container.
 
void destroyIterator (const void *iterator) const
 Destroys a non-const iterator previously created using \l begin() or \l end().
 
bool compareIterator (const void *i, const void *j) const
 Returns true if the non-const iterators i and j point to the same value in the container they are iterating over, otherwise returns false.
 
void copyIterator (void *target, const void *source) const
 Copies the non-const iterator source into the non-const iterator target.
 
void advanceIterator (void *iterator, qsizetype step) const
 Advances the non-const iterator by step steps.
 
qsizetype diffIterator (const void *i, const void *j) const
 Returns the distance between the non-const iterators i and j, the equivalent of i - j.
 
bool hasConstIterator () const
 Returns true if the underlying container offers a const iterator, false otherwise.
 
voidconstBegin (const void *container) const
 Creates and returns a const iterator pointing to the beginning of container.
 
voidconstEnd (const void *container) const
 Creates and returns a const iterator pointing to the end of container.
 
void destroyConstIterator (const void *iterator) const
 Destroys a const iterator previously created using \l constBegin() or \l constEnd().
 
bool compareConstIterator (const void *i, const void *j) const
 Returns true if the const iterators i and j point to the same value in the container they are iterating over, otherwise returns false.
 
void copyConstIterator (void *target, const void *source) const
 Copies the const iterator source into the const iterator target.
 
void advanceConstIterator (void *iterator, qsizetype step) const
 Advances the const iterator by step steps.
 
qsizetype diffConstIterator (const void *i, const void *j) const
 Returns the distance between the const iterators i and j, the equivalent of i - j.
 

Protected Attributes

const QtMetaContainerPrivate::QMetaContainerInterfaced_ptr = nullptr
 

Detailed Description

Definition at line 886 of file qmetacontainer.h.

Constructor & Destructor Documentation

◆ QMetaContainer() [1/2]

QMetaContainer::QMetaContainer ( )
default

◆ QMetaContainer() [2/2]

QMetaContainer::QMetaContainer ( const QtMetaContainerPrivate::QMetaContainerInterface * d)
inlineexplicit

Definition at line 890 of file qmetacontainer.h.

Member Function Documentation

◆ advanceConstIterator()

void QMetaContainer::advanceConstIterator ( void * iterator,
qsizetype step ) const

Advances the const iterator by step steps.

If steps is negative the iterator is moved backwards, towards the beginning of the container. The behavior is unspecified for negative values of step if \l hasBidirectionalIterator() returns false.

See also
constBegin(), constEnd()

Definition at line 750 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::advanceConstIteratorFn, d_ptr, and hasConstIterator().

Referenced by QSequentialIterable::at(), and iterateQObjectContainer().

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

◆ advanceIterator()

void QMetaContainer::advanceIterator ( void * iterator,
qsizetype step ) const

Advances the non-const iterator by step steps.

If steps is negative the iterator is moved backwards, towards the beginning of the container. The behavior is unspecified for negative values of step if \l hasBidirectionalIterator() returns false.

See also
begin(), end()

Definition at line 502 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::advanceIteratorFn, d_ptr, and hasIterator().

Referenced by QSequentialIterable::set().

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

◆ begin()

void * QMetaContainer::begin ( void * container) const

Creates and returns a non-const iterator pointing to the beginning of container.

The iterator is allocated on the heap using new. It has to be destroyed using \l destroyIterator eventually, to reclaim the memory.

Returns nullptr if the container doesn't offer any non-const iterators.

See also
end(), constBegin(), constEnd(), destroyIterator()

Definition at line 433 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::AtBegin, QtMetaContainerPrivate::QMetaContainerInterface::createIteratorFn, d_ptr, and hasIterator().

Referenced by QSequentialIterable::set().

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

◆ canClear()

bool QMetaContainer::canClear ( ) const

Returns true if the container can be cleared, false otherwise.

See also
clear()

Definition at line 273 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::clearFn, and d_ptr.

Referenced by clear().

+ Here is the caller graph for this function:

◆ clear()

void QMetaContainer::clear ( void * container) const

Clears the given container if it can be cleared.

See also
canClear()

Definition at line 283 of file qmetacontainer.cpp.

References canClear(), QtMetaContainerPrivate::QMetaContainerInterface::clearFn, and d_ptr.

+ Here is the call graph for this function:

◆ compareConstIterator()

bool QMetaContainer::compareConstIterator ( const void * i,
const void * j ) const

Returns true if the const iterators i and j point to the same value in the container they are iterating over, otherwise returns false.

See also
constBegin(), constEnd()

Definition at line 725 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::compareConstIteratorFn, d_ptr, hasConstIterator(), i, and j.

Referenced by iterateQObjectContainer().

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

◆ compareIterator()

bool QMetaContainer::compareIterator ( const void * i,
const void * j ) const

Returns true if the non-const iterators i and j point to the same value in the container they are iterating over, otherwise returns false.

See also
begin(), end()

Definition at line 477 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::compareIteratorFn, d_ptr, hasIterator(), i, and j.

+ Here is the call graph for this function:

◆ constBegin()

void * QMetaContainer::constBegin ( const void * container) const

Creates and returns a const iterator pointing to the beginning of container.

The iterator is allocated on the heap using new. It has to be destroyed using \l destroyConstIterator eventually, to reclaim the memory.

Returns nullptr if the container doesn't offer any const iterators.

See also
constEnd(), begin(), end(), destroyConstIterator()

Definition at line 681 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::AtBegin, QtMetaContainerPrivate::QMetaContainerInterface::createConstIteratorFn, d_ptr, and hasConstIterator().

Referenced by QSequentialIterable::at(), and iterateQObjectContainer().

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

◆ constEnd()

void * QMetaContainer::constEnd ( const void * container) const

Creates and returns a const iterator pointing to the end of container.

The iterator is allocated on the heap using new. It has to be destroyed using \l destroyConstIterator eventually, to reclaim the memory.

Returns nullptr if the container doesn't offer any const iterators.

See also
constBegin(), begin(), end(), destroyConstIterator()

Definition at line 698 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::AtEnd, QtMetaContainerPrivate::QMetaContainerInterface::createConstIteratorFn, d_ptr, and hasConstIterator().

Referenced by iterateQObjectContainer().

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

◆ copyConstIterator()

void QMetaContainer::copyConstIterator ( void * target,
const void * source ) const

Copies the const iterator source into the const iterator target.

Afterwards compareConstIterator(target, source) returns true.

See also
constBegin(), constEnd()

Definition at line 736 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::copyConstIteratorFn, d_ptr, and hasConstIterator().

+ Here is the call graph for this function:

◆ copyIterator()

void QMetaContainer::copyIterator ( void * target,
const void * source ) const

Copies the non-const iterator source into the non-const iterator target.

Afterwards compareIterator(target, source) returns true.

See also
begin(), end()

Definition at line 488 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::copyIteratorFn, d_ptr, and hasIterator().

+ Here is the call graph for this function:

◆ destroyConstIterator()

void QMetaContainer::destroyConstIterator ( const void * iterator) const

Destroys a const iterator previously created using \l constBegin() or \l constEnd().

See also
constBegin(), constEnd(), destroyIterator()

Definition at line 712 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::QMetaContainerInterface::destroyConstIteratorFn, and hasConstIterator().

Referenced by QSequentialIterable::at(), and iterateQObjectContainer().

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

◆ destroyIterator()

void QMetaContainer::destroyIterator ( const void * iterator) const

Destroys a non-const iterator previously created using \l begin() or \l end().

See also
begin(), end(), destroyConstIterator()

Definition at line 464 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::QMetaContainerInterface::destroyIteratorFn, and hasIterator().

Referenced by QSequentialIterable::set().

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

◆ diffConstIterator()

qsizetype QMetaContainer::diffConstIterator ( const void * i,
const void * j ) const

Returns the distance between the const iterators i and j, the equivalent of i - j.

If j is closer to the end of the container than i, the returned value is negative. The behavior is unspecified in this case if \l hasBidirectionalIterator() returns false.

See also
constBegin(), constEnd()

Definition at line 764 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::QMetaContainerInterface::diffConstIteratorFn, hasConstIterator(), i, and j.

+ Here is the call graph for this function:

◆ diffIterator()

qsizetype QMetaContainer::diffIterator ( const void * i,
const void * j ) const

Returns the distance between the non-const iterators i and j, the equivalent of i - j.

If j is closer to the end of the container than i, the returned value is negative. The behavior is unspecified in this case if \l hasBidirectionalIterator() returns false.

See also
begin(), end()

Definition at line 516 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::QMetaContainerInterface::diffIteratorFn, hasIterator(), i, and j.

+ Here is the call graph for this function:

◆ end()

void * QMetaContainer::end ( void * container) const

Creates and returns a non-const iterator pointing to the end of container.

The iterator is allocated on the heap using new. It has to be destroyed using \l destroyIterator eventually, to reclaim the memory.

Returns nullptr if the container doesn't offer any non-const iterators.

See also
hasIterator(), end(), constBegin(), constEnd(), destroyIterator()

Definition at line 450 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::QMetaContainerInterface::AtEnd, QtMetaContainerPrivate::QMetaContainerInterface::createIteratorFn, d_ptr, and hasIterator().

Referenced by QV4::Sequence::removeLast().

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

◆ hasBidirectionalIterator()

bool QMetaContainer::hasBidirectionalIterator ( ) const

Returns true if the underlying container provides a bi-directional iterator or a random access iterator as defined by std::bidirectional_iterator_tag and std::random_access_iterator_tag, respectively.

Otherwise returns false.

QMetaSequence assumes that const and non-const iterators for the same container have the same iterator traits.

Definition at line 83 of file qmetacontainer.cpp.

References QtMetaContainerPrivate::BiDirectionalCapability, d_ptr, and QtMetaContainerPrivate::QMetaContainerInterface::iteratorCapabilities.

Referenced by QTaggedIterator< Iterator, IteratorCategory >::QTaggedIterator().

+ Here is the caller graph for this function:

◆ hasConstIterator()

◆ hasForwardIterator()

bool QMetaContainer::hasForwardIterator ( ) const

Returns true if the underlying container provides at least a forward iterator as defined by std::forward_iterator_tag, otherwise returns false.

Bi-directional iterators and random access iterators are specializations of forward iterators. This method will also return true if the container provides one of those.

QMetaSequence assumes that const and non-const iterators for the same container have the same iterator traits.

Definition at line 67 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::ForwardCapability, and QtMetaContainerPrivate::QMetaContainerInterface::iteratorCapabilities.

Referenced by QTaggedIterator< Iterator, IteratorCategory >::QTaggedIterator().

+ Here is the caller graph for this function:

◆ hasInputIterator()

bool QMetaContainer::hasInputIterator ( ) const

Returns true if the underlying container provides at least an input iterator as defined by std::input_iterator_tag, otherwise returns false.

Forward, Bi-directional, and random access iterators are specializations of input iterators. This method will also return true if the container provides one of those.

QMetaSequence assumes that const and non-const iterators for the same container have the same iterator traits.

Definition at line 50 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::InputCapability, and QtMetaContainerPrivate::QMetaContainerInterface::iteratorCapabilities.

Referenced by QTaggedIterator< Iterator, IteratorCategory >::QTaggedIterator().

+ Here is the caller graph for this function:

◆ hasIterator()

◆ hasRandomAccessIterator()

bool QMetaContainer::hasRandomAccessIterator ( ) const

Returns true if the underlying container provides a random access iterator as defined by std::random_access_iterator_tag, otherwise returns false.

QMetaSequence assumes that const and non-const iterators for the same container have the same iterator traits.

Definition at line 98 of file qmetacontainer.cpp.

References d_ptr, QtMetaContainerPrivate::QMetaContainerInterface::iteratorCapabilities, and QtMetaContainerPrivate::RandomAccessCapability.

Referenced by QTaggedIterator< Iterator, IteratorCategory >::QTaggedIterator().

+ Here is the caller graph for this function:

◆ hasSize()

bool QMetaContainer::hasSize ( ) const

Returns true if the container can be queried for its size, false otherwise.

See also
size()

Definition at line 252 of file qmetacontainer.cpp.

References d_ptr, and QtMetaContainerPrivate::QMetaContainerInterface::sizeFn.

Referenced by QV4::ExecutionEngine::fromData(), QQmlListAccessor::setList(), and size().

+ Here is the caller graph for this function:

◆ size()

qsizetype QMetaContainer::size ( const void * container) const

Returns the number of values in the given container if it can be queried for its size.

Otherwise returns -1.

See also
hasSize()

Definition at line 263 of file qmetacontainer.cpp.

References d_ptr, hasSize(), and QtMetaContainerPrivate::QMetaContainerInterface::sizeFn.

Referenced by QQmlListAccessor::count(), and QV4::Sequence::virtualMetacall().

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

Member Data Documentation

◆ d_ptr


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