FX::QPtrList< type, allocator > Class Template Reference
[Qt Template Library]

#include <qptrlist.h>

Inheritance diagram for FX::QPtrList< type, allocator >:

FX::QQuickList< type, allocator > FX::QSortedList< type, allocator > List of all members.

Detailed Description

template<class type, class allocator>
class FX::QPtrList< type, allocator >

A thunk of Qt's QPtrList to the STL.

A QPtrList should be used when insertions to and removals from the centre of the list are common. Random access is slow with this list especially to near the end. If you want fast random access, use FX::QPtrVector. Iterators are not invalidated by insertions and removals.

Note that all sorts of unpleasantness has been used to get this work, including const_cast<>. Also, because of the nature of templates not being compiled until they are used, I may not have caught all the compile errors yet :(

Warning:
This list is much less forgiving of range errors than Qt. Where Qt returns false and prints a message, this list like the STL throws an exception!

Definition at line 62 of file qptrlist.h.

Public Types

typedef std::list< type *,
allocator > 
Base

Public Member Functions

 QPtrList (bool wantAutoDel=false)
 QPtrList (Base &l)
 ~QPtrList ()
bool autoDelete () const
void setAutoDelete (bool a)
uint count () const
bool isEmpty () const
bool insert (uint i, const type *d)
bool insertAtIter (QPtrListIterator< type, allocator > &it, const type *d)
void inSort (const type *d)
void prepend (const type *d)
void append (const type *d)
bool remove (uint i)
bool remove (const type *d)
bool removeRef (const type *d)
bool removeByIter (QPtrListIterator< type, allocator > &it)
bool removeFirst ()
bool removeLast ()
type * take (uint i)
bool take (const type *d)
bool takeByIter (QPtrListIterator< type, allocator > &it)
bool takeRef (const type *d)
bool takeFirst ()
bool takeLast ()
void clear ()
template<typename SortFuncSpec>
void sort (SortFuncSpec sortfunc)
void sort ()
int find (const type *d)
int findRef (const type *d)
uint contains (const type *d) const
uint containsRef (const type *d) const
bool replace (uint i, const type *d)
bool replaceAtIter (QPtrListIterator< type, allocator > &it, const type *d)
type * at (uint i)
type * getFirst () const
type * getLast () const
type * first ()
type * last ()
virtual int compareItems (type *a, type *b) const
Baseint_list ()
Base::iterator int_begin ()
Base::iterator int_end ()
template<>
void deleteItem (void *)

Protected Member Functions

virtual void deleteItem (type *d)


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:42 2009 for TnFOX by doxygen v1.4.7