ISLEman
Public Member Functions | Protected Member Functions | Friends | List of all members
QGVector Class Reference

The QGVector class is an internal class for implementing Qt collection classes. More...

#include <qgvector.h>

Inheritance diagram for QGVector:
QCollection QVector< type > QVector< QList< IndexWord > > QStrVec QStrIVec

Public Member Functions

QDataStreamread (QDataStream &)
 
QDataStreamwrite (QDataStream &) const
 
virtual int compareItems (Item, Item)
 
- Public Member Functions inherited from QCollection
bool autoDelete () const
 
void setAutoDelete (bool enable)
 

Protected Member Functions

 QGVector (uint size)
 
 QGVector (const QGVector &v)
 
QGVectoroperator= (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 QDataStreamread (QDataStream &, Item &)
 
virtual QDataStreamwrite (QDataStream &, Item) const
 
- Protected Member Functions inherited from QCollection
 QCollection ()
 
 QCollection (const QCollection &)
 
virtual ~QCollection ()
 
virtual Item newItem (Item)
 
virtual void deleteItem (Item)
 

Friends

class QGList
 

Additional Inherited Members

- Public Types inherited from QCollection
typedef void * Item
 
- Protected Attributes inherited from QCollection
bool del_item
 

Detailed Description

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.

Member Function Documentation

§ clear()

void QGVector::clear ( )
protectedvirtual

Removes all objects from the collection. The objects will be deleted if auto-delete has been enabled.

See also
setAutoDelete()

Implements QCollection.

Reimplemented in QVector< type >, and QVector< QList< IndexWord > >.

§ compareItems()

int QGVector::compareItems ( Item  d1,
Item  d2 
)
virtual

This virtual function compares two list items.

Returns:

  • 0 if item1 == item2
  • non-zero if item1 != item2

This function returns int rather than bool so that reimplementations can return one of three values and use it to sort by:

  • 0 if item1 == item2
  • > 0 (positive integer) if item1 > item2
  • < 0 (negative integer) if item1 < item2

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().

§ count()

uint QGVector::count ( ) const
inlineprotectedvirtual

Returns the number of objects in the collection.

Implements QCollection.

Reimplemented in QVector< type >, and QVector< QList< IndexWord > >.

§ read()

QDataStream & QGVector::read ( QDataStream s,
Item &  d 
)
protectedvirtual

Reads a collection/vector item from the stream s and returns a reference to the stream.

The default implementation sets item to 0.

See also
write()

§ write()

QDataStream & QGVector::write ( QDataStream s,
Item   
) const
protectedvirtual

Writes a collection/vector item to the stream s and returns a reference to the stream.

The default implementation does nothing.

See also
read()

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