Public Member Functions | Private Member Functions | List of all members
QInternalList< type > Class Template Reference

#include <qinternallist.h>

Inheritance diagram for QInternalList< type >:
QGList QCollection QStrList QStrIList

Public Member Functions

 QInternalList ()
 
 QInternalList (const QInternalList< type > &l)
 
 ~QInternalList ()
 
QInternalList< type > & operator= (const QInternalList< type > &l)
 
bool operator== (const QInternalList< type > &list) const
 
uint count () const
 
bool isEmpty () const
 
bool insert (uint i, const type *d)
 
void inSort (const type *d)
 
void prepend (const type *d)
 
void append (const type *d)
 
bool remove (uint i)
 
bool remove ()
 
bool remove (const type *d)
 
bool removeRef (const type *d)
 
void removeNode (QLNode *n)
 
bool removeFirst ()
 
bool removeLast ()
 
typetake (uint i)
 
typetake ()
 
typetakeNode (QLNode *n)
 
void clear ()
 
void sort ()
 
int find (const type *d)
 
int findNext (const type *d)
 
int findRef (const type *d)
 
int findNextRef (const type *d)
 
uint contains (const type *d) const
 
uint containsRef (const type *d) const
 
typeat (uint i)
 
int at () const
 
typecurrent () const
 
QLNodecurrentNode () const
 
typegetFirst () const
 
typegetLast () const
 
typefirst ()
 
typelast ()
 
typenext ()
 
typeprev ()
 
void toVector (QGVector *vec) const
 
- Public Member Functions inherited from QGList
QDataStreamread (QDataStream &)
 
QDataStreamwrite (QDataStream &) const
 
- Public Member Functions inherited from QCollection
bool autoDelete () const
 
void setAutoDelete (bool enable)
 

Private Member Functions

void deleteItem (QCollection::Item d)
 
template<>
void deleteItem (QCollection::Item)
 

Additional Inherited Members

- Public Types inherited from QCollection
typedef void * Item
 
- Protected Member Functions inherited from QGList
 QGList ()
 
 QGList (const QGList &)
 
virtual ~QGList ()
 
QGListoperator= (const QGList &)
 
bool operator== (const QGList &) const
 
void inSort (QCollection::Item)
 
void append (QCollection::Item)
 
bool insertAt (uint index, QCollection::Item)
 
void relinkNode (QLNode *)
 
bool removeNode (QLNode *)
 
bool remove (QCollection::Item=0)
 
bool removeRef (QCollection::Item=0)
 
bool removeFirst ()
 
bool removeLast ()
 
bool removeAt (uint index)
 
QCollection::Item takeNode (QLNode *)
 
QCollection::Item take ()
 
QCollection::Item takeAt (uint index)
 
QCollection::Item takeFirst ()
 
QCollection::Item takeLast ()
 
void sort ()
 
int findRef (QCollection::Item, bool=TRUE)
 
int find (QCollection::Item, bool=TRUE)
 
uint containsRef (QCollection::Item) const
 
uint contains (QCollection::Item) const
 
QCollection::Item at (uint index)
 
int at () const
 
QLNodecurrentNode () const
 
QCollection::Item get () const
 
QCollection::Item cfirst () const
 
QCollection::Item clast () const
 
QCollection::Item first ()
 
QCollection::Item last ()
 
QCollection::Item next ()
 
QCollection::Item prev ()
 
void toVector (QGVector *) const
 
virtual int compareItems (QCollection::Item, QCollection::Item)
 
virtual QDataStreamread (QDataStream &, QCollection::Item &)
 
virtual QDataStreamwrite (QDataStream &, QCollection::Item) const
 
- Protected Member Functions inherited from QCollection
 QCollection ()
 
 QCollection (const QCollection &)
 
virtual ~QCollection ()
 
virtual Item newItem (Item)
 
- Protected Attributes inherited from QCollection
bool del_item
 

Detailed Description

template<class type>
class QInternalList< type >

Definition at line 46 of file qinternallist.h.

Constructor & Destructor Documentation

template<class type>
QInternalList< type >::QInternalList ( )
inline

Definition at line 49 of file qinternallist.h.

49 {}
template<class type>
QInternalList< type >::QInternalList ( const QInternalList< type > &  l)
inline

Definition at line 50 of file qinternallist.h.

50 : QGList(l) {}
QGList()
Definition: qglist.cpp:170
template<class type>
QInternalList< type >::~QInternalList ( )
inline

Definition at line 51 of file qinternallist.h.

51 { clear(); }

Member Function Documentation

template<class type>
void QInternalList< type >::append ( const type d)
inline

Definition at line 61 of file qinternallist.h.

void append(QCollection::Item)
Definition: qglist.cpp:364
void * Item
Definition: qcollection.h:60
template<class type>
type* QInternalList< type >::at ( uint  i)
inline

Definition at line 81 of file qinternallist.h.

81 { return (type *)QGList::at(i); }
int at() const
Definition: qglist.h:167
template<class type>
int QInternalList< type >::at ( ) const
inline

Definition at line 82 of file qinternallist.h.

82 { return QGList::at(); }
int at() const
Definition: qglist.h:167
template<class type>
void QInternalList< type >::clear ( )
inlinevirtual

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

See also
setAutoDelete()

Reimplemented from QGList.

Definition at line 72 of file qinternallist.h.

72 { QGList::clear(); }
void clear()
Definition: qglist.cpp:652
template<class type>
uint QInternalList< type >::contains ( const type d) const
inline

Definition at line 78 of file qinternallist.h.

78 { return QGList::contains((QCollection::Item)d); }
uint contains(QCollection::Item) const
Definition: qglist.cpp:751
void * Item
Definition: qcollection.h:60
template<class type>
uint QInternalList< type >::containsRef ( const type d) const
inline

Definition at line 79 of file qinternallist.h.

uint containsRef(QCollection::Item) const
Definition: qglist.cpp:734
void * Item
Definition: qcollection.h:60
template<class type>
uint QInternalList< type >::count ( ) const
inlinevirtual

Returns the number of objects in the collection.

Reimplemented from QGList.

Definition at line 56 of file qinternallist.h.

56 { return QGList::count(); }
uint count() const
Definition: qglist.h:150
template<class type>
type* QInternalList< type >::current ( ) const
inline

Definition at line 83 of file qinternallist.h.

83 { return (type *)QGList::get(); }
QCollection::Item get() const
Definition: qglist.h:183
template<class type>
QLNode* QInternalList< type >::currentNode ( ) const
inline

Definition at line 84 of file qinternallist.h.

84 { return QGList::currentNode(); }
QLNode * currentNode() const
Definition: qglist.h:178
template<class type >
void QInternalList< type >::deleteItem ( QCollection::Item  d)
inlineprivatevirtual

Virtual function that deletes an item that is about to be removed from the collection.

The default implementation deletes d pointer if and only if auto-delete has been enabled.

This function is always reimplemented in the collection template classes.

Warning
If you reimplement this function you must also reimplement the destructor and call the virtual function clear() from your destructor. This is due to the way virtual functions and destructors work in C++: virtual functions in derived classes cannot be called from a destructor. If you do not do this your deleteItem() function will not be called when the container is destructed.
See also
newItem(), setAutoDelete()

Reimplemented from QCollection.

Reimplemented in QStrList.

Definition at line 102 of file qinternallist.h.

103 {
104  if ( del_item ) delete (type *)d;
105 }
bool del_item
Definition: qcollection.h:67
template<>
void QInternalList< void >::deleteItem ( QCollection::Item  d)
inlineprivatevirtual

Virtual function that deletes an item that is about to be removed from the collection.

The default implementation deletes d pointer if and only if auto-delete has been enabled.

This function is always reimplemented in the collection template classes.

Warning
If you reimplement this function you must also reimplement the destructor and call the virtual function clear() from your destructor. This is due to the way virtual functions and destructors work in C++: virtual functions in derived classes cannot be called from a destructor. If you do not do this your deleteItem() function will not be called when the container is destructed.
See also
newItem(), setAutoDelete()

Reimplemented from QCollection.

Definition at line 97 of file qinternallist.h.

98 {
99 }
template<class type>
int QInternalList< type >::find ( const type d)
inline

Definition at line 74 of file qinternallist.h.

74 { return QGList::find((QCollection::Item)d); }
void * Item
Definition: qcollection.h:60
int find(QCollection::Item, bool=TRUE)
Definition: qglist.cpp:708
template<class type>
int QInternalList< type >::findNext ( const type d)
inline

Definition at line 75 of file qinternallist.h.

75 { return QGList::find((QCollection::Item)d,FALSE); }
const bool FALSE
Definition: qglobal.h:370
void * Item
Definition: qcollection.h:60
int find(QCollection::Item, bool=TRUE)
Definition: qglist.cpp:708
template<class type>
int QInternalList< type >::findNextRef ( const type d)
inline

Definition at line 77 of file qinternallist.h.

const bool FALSE
Definition: qglobal.h:370
int findRef(QCollection::Item, bool=TRUE)
Definition: qglist.cpp:683
void * Item
Definition: qcollection.h:60
template<class type>
int QInternalList< type >::findRef ( const type d)
inline

Definition at line 76 of file qinternallist.h.

76 { return QGList::findRef((QCollection::Item)d); }
int findRef(QCollection::Item, bool=TRUE)
Definition: qglist.cpp:683
void * Item
Definition: qcollection.h:60
template<class type>
type* QInternalList< type >::first ( )
inline

Definition at line 87 of file qinternallist.h.

87 { return (type *)QGList::first(); }
QCollection::Item first()
Definition: qglist.cpp:807
template<class type>
type* QInternalList< type >::getFirst ( ) const
inline

Definition at line 85 of file qinternallist.h.

85 { return (type *)QGList::cfirst(); }
QCollection::Item cfirst() const
Definition: qglist.h:188
template<class type>
type* QInternalList< type >::getLast ( ) const
inline

Definition at line 86 of file qinternallist.h.

86 { return (type *)QGList::clast(); }
QCollection::Item clast() const
Definition: qglist.h:193
template<class type>
bool QInternalList< type >::insert ( uint  i,
const type d 
)
inline

Definition at line 58 of file qinternallist.h.

58 { return QGList::insertAt(i,(QCollection::Item)d); }
bool insertAt(uint index, QCollection::Item)
Definition: qglist.cpp:384
void * Item
Definition: qcollection.h:60
template<class type>
void QInternalList< type >::inSort ( const type d)
inline

Definition at line 59 of file qinternallist.h.

void inSort(QCollection::Item)
Definition: qglist.cpp:327
void * Item
Definition: qcollection.h:60
template<class type>
bool QInternalList< type >::isEmpty ( ) const
inline

Definition at line 57 of file qinternallist.h.

57 { return QGList::count() == 0; }
uint count() const
Definition: qglist.h:150
template<class type>
type* QInternalList< type >::last ( )
inline

Definition at line 88 of file qinternallist.h.

88 { return (type *)QGList::last(); }
QCollection::Item last()
Definition: qglist.cpp:821
template<class type>
type* QInternalList< type >::next ( )
inline

Definition at line 89 of file qinternallist.h.

89 { return (type *)QGList::next(); }
QCollection::Item next()
Definition: qglist.cpp:835
template<class type>
QInternalList<type>& QInternalList< type >::operator= ( const QInternalList< type > &  l)
inline

Definition at line 52 of file qinternallist.h.

53  { return (QInternalList<type>&)QGList::operator=(l); }
QGList & operator=(const QGList &)
Definition: qglist.cpp:222
template<class type>
bool QInternalList< type >::operator== ( const QInternalList< type > &  list) const
inline

Definition at line 54 of file qinternallist.h.

55  { return QGList::operator==( list ); }
bool operator==(const QGList &) const
Definition: qglist.cpp:242
template<class type>
void QInternalList< type >::prepend ( const type d)
inline

Definition at line 60 of file qinternallist.h.

bool insertAt(uint index, QCollection::Item)
Definition: qglist.cpp:384
void * Item
Definition: qcollection.h:60
template<class type>
type* QInternalList< type >::prev ( )
inline

Definition at line 90 of file qinternallist.h.

90 { return (type *)QGList::prev(); }
QCollection::Item prev()
Definition: qglist.cpp:854
template<class type>
bool QInternalList< type >::remove ( uint  i)
inline

Definition at line 62 of file qinternallist.h.

62 { return QGList::removeAt(i); }
bool removeAt(uint index)
Definition: qglist.cpp:554
template<class type>
bool QInternalList< type >::remove ( )
inline

Definition at line 63 of file qinternallist.h.

63 { return QGList::remove((QCollection::Item)0); }
bool remove(QCollection::Item=0)
Definition: qglist.cpp:504
void * Item
Definition: qcollection.h:60
template<class type>
bool QInternalList< type >::remove ( const type d)
inline

Definition at line 64 of file qinternallist.h.

64 { return QGList::remove((QCollection::Item)d); }
bool remove(QCollection::Item=0)
Definition: qglist.cpp:504
void * Item
Definition: qcollection.h:60
template<class type>
bool QInternalList< type >::removeFirst ( )
inline

Definition at line 67 of file qinternallist.h.

67 { return QGList::removeFirst(); }
bool removeFirst()
Definition: qglist.h:155
template<class type>
bool QInternalList< type >::removeLast ( )
inline

Definition at line 68 of file qinternallist.h.

68 { return QGList::removeLast(); }
bool removeLast()
Definition: qglist.h:161
template<class type>
void QInternalList< type >::removeNode ( QLNode n)
inline

Definition at line 66 of file qinternallist.h.

66 { QGList::removeNode(n); }
bool removeNode(QLNode *)
Definition: qglist.cpp:481
template<class type>
bool QInternalList< type >::removeRef ( const type d)
inline

Definition at line 65 of file qinternallist.h.

bool removeRef(QCollection::Item=0)
Definition: qglist.cpp:523
void * Item
Definition: qcollection.h:60
template<class type>
void QInternalList< type >::sort ( )
inline

Definition at line 73 of file qinternallist.h.

73 { QGList::sort(); }
void sort()
Definition: qglist.cpp:934
template<class type>
type* QInternalList< type >::take ( uint  i)
inline

Definition at line 69 of file qinternallist.h.

69 { return (type *)QGList::takeAt(i); }
QCollection::Item takeAt(uint index)
Definition: qglist.cpp:608
template<class type>
type* QInternalList< type >::take ( )
inline

Definition at line 70 of file qinternallist.h.

70 { return (type *)QGList::take(); }
QCollection::Item take()
Definition: qglist.cpp:595
template<class type>
type* QInternalList< type >::takeNode ( QLNode n)
inline

Definition at line 71 of file qinternallist.h.

71 { return (type *)QGList::takeNode(n); }
QCollection::Item takeNode(QLNode *)
Definition: qglist.cpp:572
template<class type>
void QInternalList< type >::toVector ( QGVector vec) const
inline

Definition at line 91 of file qinternallist.h.

91 { QGList::toVector(vec); }
void toVector(QGVector *) const
Definition: qglist.cpp:874

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