QVector< T > Class Template Reference
#include <audiodataoutput.h>
template<typename T>
class QVector< T >
- CurveBrush/CurveCreator.cpp, CurveBrush/CurveCreator.h, CurveBrush/CurveDisplayer.cpp, PLYImport/Importer.cpp, PtexExtractor/PtexPaintExporter.cpp, PtexExtractor/PtexPaintExporter.h, PtexExtractor/PtexUtilizer.cpp, PtexExtractor/PtexUtilizer.h, PtexImporter/PtexImporter.h, PtexImporter/PtexPaintLayerImporter.cpp, PtexImporter/PtexPaintLayerImporter.h, and STLExport/STLExporter.cpp.
Definition at line 33 of file audiodataoutput.h.
|
| QVector () |
|
| QVector (int size) |
|
| QVector (int size, const T &t) |
|
| QVector (const QVector< T > &v) |
|
| ~QVector () |
|
QVector< T > & | operator= (const QVector< T > &v) |
|
void | swap (QVector< T > &other) |
|
bool | operator== (const QVector< T > &v) const |
|
bool | operator!= (const QVector< T > &v) const |
|
int | size () const |
|
bool | isEmpty () const |
|
void | resize (int size) |
|
int | capacity () const |
|
void | reserve (int size) |
|
void | squeeze () |
|
void | detach () |
|
bool | isDetached () const |
|
void | setSharable (bool sharable) |
|
bool | isSharedWith (const QVector< T > &other) const |
|
T * | data () |
|
const T * | data () const |
|
const T * | constData () const |
|
void | clear () |
|
const T & | at (int i) const |
|
T & | operator[] (int i) |
|
const T & | operator[] (int i) const |
|
void | append (const T &t) |
|
void | prepend (const T &t) |
|
void | insert (int i, const T &t) |
|
void | insert (int i, int n, const T &t) |
|
void | replace (int i, const T &t) |
|
void | remove (int i) |
|
void | remove (int i, int n) |
|
QVector< T > & | fill (const T &t, int size=-1) |
|
int | indexOf (const T &t, int from=0) const |
|
int | lastIndexOf (const T &t, int from=-1) const |
|
bool | contains (const T &t) const |
|
int | count (const T &t) const |
|
iterator | begin () |
|
const_iterator | begin () const |
|
const_iterator | constBegin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
const_iterator | constEnd () const |
|
iterator | insert (iterator before, int n, const T &x) |
|
iterator | insert (iterator before, const T &x) |
|
iterator | erase (iterator begin, iterator end) |
|
iterator | erase (iterator pos) |
|
int | count () const |
|
T & | first () |
|
const T & | first () const |
|
T & | last () |
|
const T & | last () const |
|
bool | startsWith (const T &t) const |
|
bool | endsWith (const T &t) const |
|
QVector< T > | mid (int pos, int length=-1) const |
|
T | value (int i) const |
|
T | value (int i, const T &defaultValue) const |
|
void | push_back (const T &t) |
|
void | push_front (const T &t) |
|
void | pop_back () |
|
void | pop_front () |
|
bool | empty () const |
|
T & | front () |
|
const_reference | front () const |
|
reference | back () |
|
const_reference | back () const |
|
QVector< T > & | operator+= (const QVector< T > &l) |
|
QVector< T > | operator+ (const QVector< T > &l) const |
|
QVector< T > & | operator+= (const T &t) |
|
QVector< T > & | operator<< (const T &t) |
|
QVector< T > & | operator<< (const QVector< T > &l) |
|
QList< T > | toList () const |
|
std::vector< T > | toStdVector () const |
|
Definition at line 120 of file qvector.h.
static QVectorData shared_null
Definition at line 411 of file qvector.h.
418 if (QTypeInfo<T>::isComplex) {
420 T* i =
p->array +
d->
size;
424 qMemSet(
p->array, 0, asize *
sizeof(T));
Definition at line 429 of file qvector.h.
436 T* i =
p->array +
d->
size;
437 while (i !=
p->array)
Definition at line 130 of file qvector.h.
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
bool operator== |
( |
const QVector< T > & |
v | ) |
const |
bool operator!= |
( |
const QVector< T > & |
v | ) |
const |
|
inline |
Definition at line 135 of file qvector.h.
135 {
return !(*
this ==
v); }
Definition at line 342 of file qvector.h.
static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive)
Definition at line 147 of file qvector.h.
147 {
if (
d->
ref != 1) detach_helper(); }
bool isDetached |
( |
| ) |
const |
|
inline |
void setSharable |
( |
bool |
sharable | ) |
|
|
inline |
bool isSharedWith |
( |
const QVector< T > & |
other | ) |
const |
|
inline |
Definition at line 150 of file qvector.h.
150 {
return d == other.
d; }
const T* constData |
( |
| ) |
const |
|
inline |
const T & at |
( |
int |
i | ) |
const |
|
inline |
Definition at line 350 of file qvector.h.
351 { Q_ASSERT_X(i >= 0 && i < d->
size,
"QVector<T>::at",
"index out of range");
352 return p->array[i]; }
Definition at line 358 of file qvector.h.
359 { Q_ASSERT_X(i >= 0 && i < d->
size,
"QVector<T>::operator[]",
"index out of range");
const T & operator[] |
( |
int |
i | ) |
const |
|
inline |
Definition at line 354 of file qvector.h.
355 { Q_ASSERT_X(i >= 0 && i < d->
size,
"QVector<T>::operator[]",
"index out of range");
356 return p->array[i]; }
void append |
( |
const T & |
t | ) |
|
Definition at line 573 of file qvector.h.
578 QTypeInfo<T>::isStatic));
579 if (QTypeInfo<T>::isComplex)
580 new (
p->array +
d->
size) T(copy);
584 if (QTypeInfo<T>::isComplex)
static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive)
void prepend |
( |
const T & |
t | ) |
|
|
inline |
Definition at line 378 of file qvector.h.
void insert(int i, const T &t)
Definition at line 362 of file qvector.h.
363 { Q_ASSERT_X(i >= 0 && i <= d->
size,
"QVector<T>::insert",
"index out of range");
void insert(int i, const T &t)
Definition at line 366 of file qvector.h.
367 { Q_ASSERT_X(i >= 0 && i <= d->
size,
"QVector<T>::insert",
"index out of range");
void insert(int i, const T &t)
void replace |
( |
int |
i, |
|
|
const T & |
t |
|
) |
| |
|
inline |
Definition at line 382 of file qvector.h.
384 Q_ASSERT_X(i >= 0 && i < d->
size,
"QVector<T>::replace",
"index out of range");
Definition at line 374 of file qvector.h.
375 { Q_ASSERT_X(i >= 0 && i < d->
size,
"QVector<T>::remove",
"index out of range");
iterator erase(iterator begin, iterator end)
Definition at line 370 of file qvector.h.
371 { Q_ASSERT_X(i >= 0 &&
n >= 0 && i +
n <= d->size,
"QVector<T>::remove",
"index out of range");
iterator erase(iterator begin, iterator end)
QVector< T > & fill |
( |
const T & |
t, |
|
|
int |
size = -1 |
|
) |
| |
int indexOf |
( |
const T & |
t, |
|
|
int |
from = 0 |
|
) |
| const |
Definition at line 698 of file qvector.h.
701 from = qMax(from +
d->
size, 0);
702 if (from < d->
size) {
703 T*
n =
p->array + from - 1;
704 T* e =
p->array +
d->
size;
int lastIndexOf |
( |
const T & |
t, |
|
|
int |
from = -1 |
|
) |
| const |
Definition at line 713 of file qvector.h.
717 else if (from >=
d->
size)
721 T*
n =
p->array + from + 1;
bool contains |
( |
const T & |
t | ) |
const |
Definition at line 593 of file qvector.h.
600 QTypeInfo<T>::isStatic));
601 if (QTypeInfo<T>::isStatic) {
617 memmove(i, b, (
d->
size - offset) *
sizeof(T));
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive)
Definition at line 254 of file qvector.h.
254 {
return insert(before, 1,
x); }
void insert(int i, const T &t)
Definition at line 627 of file qvector.h.
629 int f =
int(abegin -
p->array);
630 int l =
int(aend -
p->array);
633 if (QTypeInfo<T>::isComplex) {
642 memmove(
p->array + f,
p->array + l, (
d->
size-l)*
sizeof(T));
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
Definition at line 256 of file qvector.h.
256 {
return erase(pos, pos+1); }
iterator erase(iterator begin, iterator end)
bool startsWith |
( |
const T & |
t | ) |
const |
|
inline |
bool endsWith |
( |
const T & |
t | ) |
const |
|
inline |
Q_OUTOFLINE_TEMPLATE QVector< T > mid |
( |
int |
pos, |
|
|
int |
length = -1 |
|
) |
| const |
Definition at line 754 of file qvector.h.
764 for (
int i = pos; i < pos +
length; ++i)
const T & at(int i) const
GLuint GLsizei GLsizei * length
Q_OUTOFLINE_TEMPLATE T value |
( |
int |
i | ) |
const |
Q_OUTOFLINE_TEMPLATE T value |
( |
int |
i, |
|
|
const T & |
defaultValue |
|
) |
| const |
Definition at line 567 of file qvector.h.
569 return ((i < 0 || i >=
d->
size) ? defaultValue :
p->array[i]);
void push_back |
( |
const T & |
t | ) |
|
|
inline |
void push_front |
( |
const T & |
t | ) |
|
|
inline |
Definition at line 283 of file qvector.h.
iterator erase(iterator begin, iterator end)
Definition at line 284 of file qvector.h.
iterator erase(iterator begin, iterator end)
Definition at line 679 of file qvector.h.
682 realloc(
d->
size, newSize);
684 T *
w =
p->array + newSize;
688 if (QTypeInfo<T>::isComplex)
GLubyte GLubyte GLubyte GLubyte w
QVector<T>& operator+= |
( |
const T & |
t | ) |
|
|
inline |
QVector<T>& operator<< |
( |
const T & |
t | ) |
|
|
inline |
Definition at line 300 of file qvector.h.
301 { *
this += l;
return *
this; }
Q_OUTOFLINE_TEMPLATE QList< T > toList |
( |
| ) |
const |
Definition at line 770 of file qvector.h.
774 for (
int i = 0; i <
size(); ++i)
const T & at(int i) const
Definition at line 789 of file qvector.h.
QVector< T > toVector() const
static QVector<T> fromStdVector |
( |
const std::vector< T > & |
vector | ) |
|
|
inlinestatic |
Definition at line 308 of file qvector.h.
309 {
QVector<T> tmp; tmp.
reserve(
int(vector.size()));
qCopy(vector.begin(), vector.end(), std::back_inserter(tmp));
return tmp; }
OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
std::vector<T> toStdVector |
( |
| ) |
const |
|
inline |
Definition at line 310 of file qvector.h.
const_iterator constEnd() const
const_iterator constBegin() const
OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
The documentation for this class was generated from the following files: