Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
QGListIterator Class Reference

The QGListIterator class is an internal class for implementing QListIterator. More...

#include <qglist.h>

Inheritance diagram for QGListIterator:
QInternalListIterator< type > QInternalListIterator< QCacheItem > QListIterator< type > QListIterator< AlphaIndexTableCell > QListIterator< BaseClassDef > QListIterator< ChildNodeHandler > QListIterator< ClassDef > QListIterator< CodeLineHandler > QListIterator< CompoundEntry > QListIterator< Definition > QListIterator< DiagramRow > QListIterator< DocImpl > QListIterator< EdgeLabelHandler > QListIterator< ElemImpl > QListIterator< EntryHandler > QListIterator< FileDef > QListIterator< FileName > QListIterator< Formula > QListIterator< GroupDef > QListIterator< HtmlAttrib > QListIterator< IncludeHandler > QListIterator< LinkedTextImpl > QListIterator< MemberDef > QListIterator< MemberGroup > QListIterator< MemberHandler > QListIterator< MemberInfo > QListIterator< MemberReference > QListIterator< NamespaceDef > QListIterator< NodeHandler > QListIterator< ParameterHandler > QListIterator< ParameterItemHandler > QListIterator< ParamHandler > QListIterator< QString > QListIterator< RelatedCompound > QListIterator< RowHandler > QListIterator< SectionHandler > QListIterator< T > QListIterator< TemplateVariant > QListIterator< VariableListEntryHandler >

Protected Member Functions

 QGListIterator (const QGList &)
 
 QGListIterator (const QGListIterator &)
 
QGListIteratoroperator= (const QGListIterator &)
 
 ~QGListIterator ()
 
bool atFirst () const
 
bool atLast () const
 
QCollection::Item toFirst ()
 
QCollection::Item toLast ()
 
QCollection::Item get () const
 
QCollection::Item operator() ()
 
QCollection::Item operator++ ()
 
QCollection::Item operator+= (uint)
 
QCollection::Item operator-- ()
 
QCollection::Item operator-= (uint)
 

Protected Attributes

QGListlist
 

Private Attributes

QLNodecurNode
 

Friends

class QGList
 

Detailed Description

The QGListIterator class is an internal class for implementing QListIterator.

QGListIterator is a strictly internal class that does the heavy work for QListIterator.

Definition at line 212 of file qglist.h.

Constructor & Destructor Documentation

QGListIterator::QGListIterator ( const QGList l)
protected

Definition at line 1055 of file qglist.cpp.

1056 {
1057  list = (QGList *)&l; // get reference to list
1058  curNode = list->firstNode; // set to first node
1059  if ( !list->iterators ) {
1060  list->iterators = new QGList; // create iterator list
1061  CHECK_PTR( list->iterators );
1062  }
1063  list->iterators->append( this ); // attach iterator to list
1064 }
void append(QCollection::Item)
Definition: qglist.cpp:364
QGList * list
Definition: qglist.h:234
QGList * iterators
Definition: qglist.h:143
friend class QGList
Definition: qglist.h:214
The QGList class is an internal class for implementing Qt collection classes.
Definition: qglist.h:68
QLNode * firstNode
Definition: qglist.h:138
#define CHECK_PTR(p)
Definition: qglobal.h:601
QLNode * curNode
Definition: qglist.h:237
QGListIterator::QGListIterator ( const QGListIterator it)
protected

Definition at line 1071 of file qglist.cpp.

1072 {
1073  list = it.list;
1074  curNode = it.curNode;
1075  if ( list )
1076  list->iterators->append( this ); // attach iterator to list
1077 }
void append(QCollection::Item)
Definition: qglist.cpp:364
QGList * list
Definition: qglist.h:234
QGList * iterators
Definition: qglist.h:143
QLNode * curNode
Definition: qglist.h:237
QGListIterator::~QGListIterator ( )
protected

Definition at line 1101 of file qglist.cpp.

1102 {
1103  if ( list ) // detach iterator from list
1104  list->iterators->removeRef(this);
1105 }
QGList * list
Definition: qglist.h:234
bool removeRef(QCollection::Item=0)
Definition: qglist.cpp:523
QGList * iterators
Definition: qglist.h:143

Member Function Documentation

bool QGListIterator::atFirst ( ) const
inlineprotected

Definition at line 241 of file qglist.h.

242 {
243  return curNode == list->firstNode;
244 }
QGList * list
Definition: qglist.h:234
QLNode * firstNode
Definition: qglist.h:138
QLNode * curNode
Definition: qglist.h:237
bool QGListIterator::atLast ( ) const
inlineprotected

Definition at line 246 of file qglist.h.

247 {
248  return curNode == list->lastNode;
249 }
QGList * list
Definition: qglist.h:234
QLNode * lastNode
Definition: qglist.h:139
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::get ( ) const
inlineprotected

Definition at line 251 of file qglist.h.

252 {
253  return curNode ? curNode->data : 0;
254 }
QLNode * curNode
Definition: qglist.h:237
QCollection::Item data
Definition: qglist.h:57
QCollection::Item QGListIterator::operator() ( )
protected

Definition at line 1166 of file qglist.cpp.

1167 {
1168  if ( !curNode )
1169  return 0;
1171  curNode = curNode->next;
1172  return d;
1173 }
QCollection::Item getData()
Definition: qglist.h:55
QLNode * next
Definition: qglist.h:59
QLNode * curNode
Definition: qglist.h:237
void * Item
Definition: qcollection.h:60
QCollection::Item QGListIterator::operator++ ( )
protected

Definition at line 1180 of file qglist.cpp.

1181 {
1182  if ( !curNode )
1183  return 0;
1184  curNode = curNode->next;
1185  return curNode ? curNode->getData() : 0;
1186 }
QCollection::Item getData()
Definition: qglist.h:55
QLNode * next
Definition: qglist.h:59
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::operator+= ( uint  jumps)
protected

Definition at line 1193 of file qglist.cpp.

1194 {
1195  while ( curNode && jumps-- )
1196  curNode = curNode->next;
1197  return curNode ? curNode->getData() : 0;
1198 }
QCollection::Item getData()
Definition: qglist.h:55
QLNode * next
Definition: qglist.h:59
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::operator-- ( )
protected

Definition at line 1205 of file qglist.cpp.

1206 {
1207  if ( !curNode )
1208  return 0;
1209  curNode = curNode->prev;
1210  return curNode ? curNode->getData() : 0;
1211 }
QCollection::Item getData()
Definition: qglist.h:55
QLNode * prev
Definition: qglist.h:58
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::operator-= ( uint  jumps)
protected

Definition at line 1218 of file qglist.cpp.

1219 {
1220  while ( curNode && jumps-- )
1221  curNode = curNode->prev;
1222  return curNode ? curNode->getData() : 0;
1223 }
QCollection::Item getData()
Definition: qglist.h:55
QLNode * prev
Definition: qglist.h:58
QLNode * curNode
Definition: qglist.h:237
QGListIterator & QGListIterator::operator= ( const QGListIterator it)
protected

Definition at line 1085 of file qglist.cpp.

1086 {
1087  if ( list ) // detach from old list
1088  list->iterators->removeRef( this );
1089  list = it.list;
1090  curNode = it.curNode;
1091  if ( list )
1092  list->iterators->append( this ); // attach to new list
1093  return *this;
1094 }
void append(QCollection::Item)
Definition: qglist.cpp:364
QGList * list
Definition: qglist.h:234
bool removeRef(QCollection::Item=0)
Definition: qglist.cpp:523
QGList * iterators
Definition: qglist.h:143
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::toFirst ( )
protected

Definition at line 1126 of file qglist.cpp.

1127 {
1128  if ( !list ) {
1129 #if defined(CHECK_NULL)
1130  qWarning( "QGListIterator::toFirst: List has been deleted" );
1131 #endif
1132  return 0;
1133  }
1134  return list->firstNode ? (curNode = list->firstNode)->getData() : 0;
1135 }
QGList * list
Definition: qglist.h:234
void qWarning(const char *msg,...)
Definition: qglobal.cpp:409
QLNode * firstNode
Definition: qglist.h:138
QLNode * curNode
Definition: qglist.h:237
QCollection::Item QGListIterator::toLast ( )
protected

Definition at line 1142 of file qglist.cpp.

1143 {
1144  if ( !list ) {
1145 #if defined(CHECK_NULL)
1146  qWarning( "QGListIterator::toLast: List has been deleted" );
1147 #endif
1148  return 0;
1149  }
1150  return list->lastNode ? (curNode = list->lastNode)->getData() : 0;
1151 }
QGList * list
Definition: qglist.h:234
void qWarning(const char *msg,...)
Definition: qglobal.cpp:409
QLNode * lastNode
Definition: qglist.h:139
QLNode * curNode
Definition: qglist.h:237

Friends And Related Function Documentation

friend class QGList
friend

Definition at line 214 of file qglist.h.

Member Data Documentation

QLNode* QGListIterator::curNode
private

Definition at line 237 of file qglist.h.

QGList* QGListIterator::list
protected

Definition at line 234 of file qglist.h.


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