![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qmetacontainer.h>
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. | |
void * | begin (void *container) const |
Creates and returns a non-const iterator pointing to the beginning of container. | |
void * | end (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. | |
void * | constBegin (const void *container) const |
Creates and returns a const iterator pointing to the beginning of container. | |
void * | constEnd (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::QMetaContainerInterface * | d_ptr = nullptr |
\inmodule QtCore
The QMetaContainer class provides common functionality for sequential and associative containers.
QMetaContainer is part of Qt's meta-type system that allows type-erased access to container-like types at runtime.
It serves as a common base for accessing properties of containers in a generic way, such as size, iteration, and clearing operations, without knowing the actual container type.
Derived classes, such as QMetaSequence, provide specialized interfaces for sequential containers.
\compares equality
Definition at line 886 of file qmetacontainer.h.
|
default |
|
inlineexplicit |
Definition at line 890 of file qmetacontainer.h.
Advances the const iterator by step steps.
If step 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.
Definition at line 772 of file qmetacontainer.cpp.
Advances the non-const iterator by step steps.
If step 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.
Definition at line 524 of file qmetacontainer.cpp.
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.
Definition at line 455 of file qmetacontainer.cpp.
bool QMetaContainer::canClear | ( | ) | const |
Returns true
if the container can be cleared, false
otherwise.
Definition at line 295 of file qmetacontainer.cpp.
Clears the given container if it can be cleared.
Definition at line 305 of file qmetacontainer.cpp.
Returns true
if the const iterators i and j point to the same value in the container they are iterating over, otherwise returns false
.
Definition at line 747 of file qmetacontainer.cpp.
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
.
Definition at line 499 of file qmetacontainer.cpp.
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.
Definition at line 703 of file qmetacontainer.cpp.
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.
Definition at line 720 of file qmetacontainer.cpp.
Copies the const iterator source into the const iterator target.
Afterwards compareConstIterator(target, source) returns true
.
Definition at line 758 of file qmetacontainer.cpp.
Copies the non-const iterator source into the non-const iterator target.
Afterwards compareIterator(target, source) returns true
.
Definition at line 510 of file qmetacontainer.cpp.
Destroys a const iterator previously created using \l constBegin() or \l constEnd().
Definition at line 734 of file qmetacontainer.cpp.
Destroys a non-const iterator previously created using \l begin() or \l end().
Definition at line 486 of file qmetacontainer.cpp.
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.
Definition at line 786 of file qmetacontainer.cpp.
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.
Definition at line 538 of file qmetacontainer.cpp.
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.
Definition at line 472 of file qmetacontainer.cpp.
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 105 of file qmetacontainer.cpp.
bool QMetaContainer::hasConstIterator | ( | ) | const |
Returns true
if the underlying container offers a const iterator, false
otherwise.
Definition at line 682 of file qmetacontainer.cpp.
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 89 of file qmetacontainer.cpp.
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 72 of file qmetacontainer.cpp.
bool QMetaContainer::hasIterator | ( | ) | const |
Returns true
if the underlying container offers a non-const iterator, false
otherwise.
Definition at line 434 of file qmetacontainer.cpp.
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 120 of file qmetacontainer.cpp.
bool QMetaContainer::hasSize | ( | ) | const |
Returns true
if the container can be queried for its size, false
otherwise.
Definition at line 274 of file qmetacontainer.cpp.
Returns the number of values in the given container if it can be queried for its size.
Otherwise returns -1
.
Definition at line 285 of file qmetacontainer.cpp.
|
protected |
Definition at line 922 of file qmetacontainer.h.