The QGVector class is an internal class for implementing Qt collection classes. More...
#include <qgvector.h>
Public Member Functions | |
QDataStream & | read (QDataStream &) |
QDataStream & | write (QDataStream &) const |
virtual int | compareItems (Item, Item) |
Public Member Functions inherited from QCollection | |
bool | autoDelete () const |
void | setAutoDelete (bool enable) |
Protected Member Functions | |
QGVector () | |
QGVector (uint size) | |
QGVector (const QGVector &v) | |
~QGVector () | |
QGVector & | operator= (const QGVector &v) |
Item * | data () const |
uint | size () const |
uint | count () const |
bool | insert (uint index, Item) |
bool | remove (uint index) |
Item | take (uint index) |
void | clear () |
bool | resize (uint newsize) |
bool | fill (Item, int flen) |
void | sort () |
int | bsearch (Item) const |
int | findRef (Item, uint index) const |
int | find (Item, uint index) const |
uint | containsRef (Item) const |
uint | contains (Item) const |
Item | at (uint index) const |
bool | insertExpand (uint index, Item) |
void | toList (QGList *) const |
virtual QDataStream & | read (QDataStream &, Item &) |
virtual QDataStream & | write (QDataStream &, Item) const |
Protected Member Functions inherited from QCollection | |
QCollection () | |
QCollection (const QCollection &) | |
virtual | ~QCollection () |
virtual Item | newItem (Item) |
virtual void | deleteItem (Item) |
Static Private Member Functions | |
static void | warningIndexRange (uint) |
Private Attributes | |
Item * | vec |
uint | len |
uint | numItems |
Friends | |
class | QGList |
Additional Inherited Members | |
Public Types inherited from QCollection | |
typedef void * | Item |
Protected Attributes inherited from QCollection | |
bool | del_item |
The QGVector class is an internal class for implementing Qt collection classes.
QGVector is a strictly internal class that acts as a base class for the QVector collection class.
QGVector has some virtual functions that may be reimplemented in subclasses to to customize behavior.
Definition at line 46 of file qgvector.h.
|
protected |
Definition at line 154 of file qgvector.cpp.
|
protected |
Definition at line 163 of file qgvector.cpp.
|
protected |
Definition at line 180 of file qgvector.cpp.
|
protected |
Definition at line 197 of file qgvector.cpp.
Definition at line 85 of file qgvector.h.
|
protected |
Definition at line 439 of file qgvector.cpp.
|
protectedvirtual |
Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled.
Implements QCollection.
Reimplemented in QVector< type >, and QVector< QList< IndexWord > >.
Definition at line 313 of file qgvector.cpp.
This virtual function compares two list items.
Returns:
This function returns int rather than bool so that reimplementations can return one of three values and use it to sort by:
The QVector::sort() and QVector::bsearch() functions require that compareItems() is implemented as described here.
This function should not modify the vector because some const functions call compareItems().
Reimplemented in QStrIVec, and QStrVec.
Definition at line 110 of file qgvector.cpp.
Definition at line 536 of file qgvector.cpp.
Definition at line 522 of file qgvector.cpp.
|
inlineprotectedvirtual |
Returns the number of objects in the collection.
Implements QCollection.
Reimplemented in QVector< type >, and QVector< QList< IndexWord > >.
Definition at line 66 of file qgvector.h.
|
inlineprotected |
Definition at line 64 of file qgvector.h.
Definition at line 377 of file qgvector.cpp.
Definition at line 501 of file qgvector.cpp.
Definition at line 482 of file qgvector.cpp.
Definition at line 246 of file qgvector.cpp.
Definition at line 553 of file qgvector.cpp.
Definition at line 207 of file qgvector.cpp.
QDataStream & QGVector::read | ( | QDataStream & | s | ) |
Definition at line 606 of file qgvector.cpp.
|
protectedvirtual |
Reads a collection/vector item from the stream s and returns a reference to the stream.
The default implementation sets item to 0.
Reimplemented in QStrVec.
Definition at line 125 of file qgvector.cpp.
Definition at line 273 of file qgvector.cpp.
Definition at line 330 of file qgvector.cpp.
|
inlineprotected |
Definition at line 65 of file qgvector.h.
|
protected |
Definition at line 410 of file qgvector.cpp.
|
protected |
Definition at line 293 of file qgvector.cpp.
|
protected |
Definition at line 568 of file qgvector.cpp.
|
staticprivate |
Definition at line 578 of file qgvector.cpp.
QDataStream & QGVector::write | ( | QDataStream & | s | ) | const |
Definition at line 627 of file qgvector.cpp.
|
protectedvirtual |
Writes a collection/vector item to the stream s and returns a reference to the stream.
The default implementation does nothing.
Reimplemented in QStrVec.
Definition at line 140 of file qgvector.cpp.
|
friend |
Definition at line 48 of file qgvector.h.
|
private |
Definition at line 104 of file qgvector.h.
|
private |
Definition at line 105 of file qgvector.h.
|
private |
Definition at line 103 of file qgvector.h.