FX::QQuickList< type > Class Template Reference

#include <qptrlist.h>

Inheritance diagram for FX::QQuickList< type >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class type>
class FX::QQuickList< type >

A FX::QPtrList with move semantics.

This is a low overhead list which copies destructively and always has auto-deletion enabled. Ideal for a list being passed around a lot.

Public Member Functions

 QQuickList ()
 QQuickList (QQuickList &o)
QQuickListoperator= (QQuickList &o)
 QQuickList (QPtrList< type > &o)
const QPtrList< type > & asPtrList () const throw ()

Protected Member Functions

bool autoDelete () const
void setAutoDelete (bool a)
uint count () const
bool isEmpty () const
bool insert (uint i, const type *d)
bool insertAtIter (QPtrListIterator< type > &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 > &it)
bool removeFirst ()
bool removeLast ()
type * take (uint i)
bool take (const type *d)
bool takeByIter (QPtrListIterator< type > &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 > &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
std::list< type * > & int_list ()
std::list< type * >::iterator int_begin ()
std::list< type * >::iterator int_end ()
virtual void deleteItem (type *d)
template<>
void deleteItem (void *)

Friends

class QQuickListIterator< type >
FXStreamoperator<< (FXStream &s, const QQuickList< type > &_i)
FXStreamoperator>> (FXStream &s, QQuickList< type > &_i)


Constructor & Destructor Documentation

template<class type>
FX::QQuickList< type >::QQuickList (  )  [inline]

Creates an instance.

template<class type>
FX::QQuickList< type >::QQuickList ( QQuickList< type > &  o  )  [inline]

Destructively copies a list very quickly.

References FX::QPtrList< type >::clear().

template<class type>
FX::QQuickList< type >::QQuickList ( QPtrList< type > &  o  )  [inline, explicit]

Destructively copies a FX::QPtrList very quickly.


Member Function Documentation

template<class type>
const QPtrList<type>& FX::QQuickList< type >::asPtrList (  )  const throw () [inline]

Returns the list as a FX::QPtrList.

template<class type>
bool FX::QPtrList< type >::autoDelete (  )  const [inline, inherited]

Returns if auto-deletion is enabled.

template<class type>
void FX::QPtrList< type >::setAutoDelete ( bool  a  )  [inline, inherited]

Sets if auto-deletion is enabled.

template<class type>
uint FX::QPtrList< type >::count (  )  const [inline, inherited]

Returns the number of items in the list.

Referenced by FX::QPtrList< type >::contains(), and FX::QPtrList< type >::containsRef().

template<class type>
bool FX::QPtrList< type >::isEmpty (  )  const [inline, inherited]

template<class type>
bool FX::QPtrList< type >::insert ( uint  i,
const type *  d 
) [inline, inherited]

Inserts item d into the list at index i.

References FXEXCEPTION_STL1, and FXEXCEPTION_STL2.

template<class type>
bool FX::QPtrList< type >::insertAtIter ( QPtrListIterator< type > &  it,
const type *  d 
) [inline, inherited]

Inserts item d into the list at where iterator it points.

References FXEXCEPTION_STL1, FXEXCEPTION_STL2, and FX::QPtrListIterator< type >::int_getIterator().

template<class type>
void FX::QPtrList< type >::inSort ( const type *  d  )  [inline, inherited]

Inserts item d into the list in its correct sorted order.

References FX::QPtrList< type >::compareItems(), FXEXCEPTION_STL1, and FXEXCEPTION_STL2.

template<class type>
void FX::QPtrList< type >::prepend ( const type *  d  )  [inline, inherited]

Prepends item d onto the list.

References FXEXCEPTION_STL1, and FXEXCEPTION_STL2.

template<class type>
void FX::QPtrList< type >::append ( const type *  d  )  [inline, inherited]

Appends the item d onto the list.

References FXEXCEPTION_STL1, and FXEXCEPTION_STL2.

template<class type>
bool FX::QPtrList< type >::remove ( uint  i  )  [inline, inherited]

Removes the item at index i.

References FX::QPtrList< type >::isEmpty().

template<class type>
bool FX::QPtrList< type >::remove ( const type *  d  )  [inline, inherited]

Removes the specified item d via compareItems().

Reimplemented in FX::QSortedList< type >.

References FX::QPtrList< type >::compareItems().

template<class type>
bool FX::QPtrList< type >::removeRef ( const type *  d  )  [inline, inherited]

Removes the specified item d via pointer compare (quicker).

Reimplemented in FX::QSortedList< type >.

template<class type>
bool FX::QPtrList< type >::removeByIter ( QPtrListIterator< type > &  it  )  [inline, inherited]

Removes the item pointed to by it (quickest).

References FX::QPtrListIterator< type >::int_getIterator().

template<class type>
bool FX::QPtrList< type >::removeFirst (  )  [inline, inherited]

Removes the first item.

References FX::QPtrList< type >::isEmpty().

template<class type>
bool FX::QPtrList< type >::removeLast (  )  [inline, inherited]

Removes the last item.

References FX::QPtrList< type >::isEmpty().

template<class type>
type* FX::QPtrList< type >::take ( uint  i  )  [inline, inherited]

Removes the item at index i without auto-deletion.

References FX::QPtrList< type >::isEmpty().

template<class type>
bool FX::QPtrList< type >::take ( const type *  d  )  [inline, inherited]

Removes the specified item d via compareItems() without auto-deletion.

Reimplemented in FX::QSortedList< type >.

References FX::QPtrList< type >::compareItems().

template<class type>
bool FX::QPtrList< type >::takeByIter ( QPtrListIterator< type > &  it  )  [inline, inherited]

Removes the item pointed to by it without auto-deletion (quickest).

References FX::QPtrListIterator< type >::int_getIterator().

template<class type>
bool FX::QPtrList< type >::takeRef ( const type *  d  )  [inline, inherited]

Removes the specified item d via pointer compare (quicker) without auto-deletion.

Reimplemented in FX::QSortedList< type >.

template<class type>
bool FX::QPtrList< type >::takeFirst (  )  [inline, inherited]

Removes the first item without auto-deletion.

References FX::QPtrList< type >::isEmpty().

template<class type>
bool FX::QPtrList< type >::takeLast (  )  [inline, inherited]

Removes the last item without auto-deletion.

References FX::QPtrList< type >::isEmpty().

template<class type>
void FX::QPtrList< type >::clear (  )  [inline, inherited]

Clears the list.

Referenced by FX::QQuickList< type >::QQuickList().

template<class type>
template<typename SortFuncSpec>
void FX::QPtrList< type >::sort ( SortFuncSpec  sortfunc  )  [inline, inherited]

Sorts the list using a user supplied callable entity taking two pointers of type type.

References FX::QValueListQSort< type, movePolicy, swapPolicy, comparePolicy >::run().

template<class type>
void FX::QPtrList< type >::sort (  )  [inline, inherited]

template<class type>
int FX::QPtrList< type >::find ( const type *  d  )  [inline, inherited]

Returns the index of the position of item d via compareItems(), or -1 if not found.

References FX::QPtrList< type >::compareItems().

template<class type>
int FX::QPtrList< type >::findRef ( const type *  d  )  [inline, inherited]

Returns the index of the position of item d via pointer compare, or -1 if not found.

template<class type>
uint FX::QPtrList< type >::contains ( const type *  d  )  const [inline, inherited]

Returns the number of item d in the list via compareItems().

References FX::QPtrList< type >::compareItems(), and FX::QPtrList< type >::count().

template<class type>
uint FX::QPtrList< type >::containsRef ( const type *  d  )  const [inline, inherited]

Returns the number of item d in the list via pointer compare.

References FX::QPtrList< type >::count().

template<class type>
bool FX::QPtrList< type >::replace ( uint  i,
const type *  d 
) [inline, inherited]

Replaces item at index i with d.

References FX::QPtrList< type >::isEmpty().

template<class type>
bool FX::QPtrList< type >::replaceAtIter ( QPtrListIterator< type > &  it,
const type *  d 
) [inline, inherited]

Replaces item at iterator with d.

References FX::QPtrListIterator< type >::int_getIterator().

template<class type>
type* FX::QPtrList< type >::at ( uint  i  )  [inline, inherited]

Returns the item at index i.

template<class type>
type* FX::QPtrList< type >::getFirst (  )  const [inline, inherited]

Returns the first item in the list.

template<class type>
type* FX::QPtrList< type >::getLast (  )  const [inline, inherited]

Returns the last item in the list.

template<class type>
type* FX::QPtrList< type >::first (  )  [inline, inherited]

Returns the first item in the list.

template<class type>
type* FX::QPtrList< type >::last (  )  [inline, inherited]

Returns the last item in the list.

template<class type>
virtual int FX::QPtrList< type >::compareItems ( type *  a,
type *  b 
) const [inline, virtual, inherited]

Compares two items (used by many methods above). Default returns -1 if a < b, +1 if a > b and 0 if a==b.

Reimplemented in FX::QSortedList< type >.

Referenced by FX::QPtrList< type >::contains(), FX::QPtrList< type >::find(), FX::QPtrList< type >::inSort(), FX::QPtrList< type >::remove(), and FX::QPtrList< type >::take().


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:28:33 2008 for TnFOX by doxygen v1.5.6