ListIterator Class Reference

#include <Util.h>

Collaboration diagram for ListIterator:

Collaboration graph
[legend]

Public Member Functions

 ListIterator (ListNode *head)
bool hasElement ()
void reset ()
void * nextElement (bool isRemove=false)
void * getElement (int index)

Detailed Description

Definition at line 28 of file Util.h.


Constructor & Destructor Documentation

ListIterator::ListIterator ( ListNode head  )  [inline]

Definition at line 35 of file Util.h.

00035 { iter = head; start = head; }


Member Function Documentation

void* ListIterator::getElement ( int  index  )  [inline]

Definition at line 56 of file Util.h.

References ListNode::element, and ListNode::next.

00057     {
00058         ListNode *localIter = start;
00059         if (localIter == NULL) return NULL;
00060         for (int i=0; i <index; i++) {
00061            localIter = localIter->next;
00062            if (localIter == NULL) break;
00063         }
00064         return localIter->element;
00065     }

bool ListIterator::hasElement (  )  [inline]

Definition at line 37 of file Util.h.

Referenced by SqlLogConnection::commit(), CreateTblStatement::execute(), SqlOdbcStatement::execute(), SqlOdbcStatement::fetch(), SqlOdbcStatement::fetchAndPrint(), SqlOdbcStatement::free(), SelStatement::getFieldName(), SqlOdbcStatement::getParamFldInfo(), SelStatement::getProjFldInfo(), SqlOdbcStatement::getProjFldInfo(), handleEchoAndComment(), insert(), SqlLogConnection::isTableCached(), CacheTableLoader::load(), main(), SqlLogConnection::removePreparePacket(), ParsedData::reset(), SelStatement::resolve(), InsStatement::resolve(), CreateTblStatement::resolve(), UpdStatement::resolveForAssignment(), DelStatement::resolveForCondition(), SqlLogConnection::rollback(), and yyparse().

00038     {
00039         if (iter == NULL) return false; else return true;
00040     }

Here is the caller graph for this function:

void* ListIterator::nextElement ( bool  isRemove = false  )  [inline]

Definition at line 47 of file Util.h.

References ListNode::element, and ListNode::next.

Referenced by SqlLogConnection::commit(), CreateTblStatement::execute(), SqlOdbcStatement::execute(), SqlOdbcStatement::fetch(), SqlOdbcStatement::fetchAndPrint(), SqlOdbcStatement::free(), SelStatement::getFieldName(), SqlOdbcStatement::getParamFldInfo(), SelStatement::getProjFldInfo(), SqlOdbcStatement::getProjFldInfo(), handleEchoAndComment(), insert(), SqlLogConnection::isTableCached(), CacheTableLoader::load(), main(), SqlLogConnection::removePreparePacket(), ParsedData::reset(), SelStatement::resolve(), InsStatement::resolve(), CreateTblStatement::resolve(), UpdStatement::resolveForAssignment(), DelStatement::resolveForCondition(), SqlLogConnection::rollback(), verifyPrimKeyFldVal(), and yyparse().

00048     {
00049         if (iter == NULL) return NULL;
00050         ListNode *node = iter;
00051         iter = iter ->next;
00052         return node->element;
00053     }

Here is the caller graph for this function:

void ListIterator::reset (  )  [inline]

Definition at line 42 of file Util.h.

Referenced by main(), ParsedData::reset(), SelStatement::resolve(), InsStatement::resolve(), CreateTblStatement::resolve(), UpdStatement::resolveForAssignment(), DelStatement::resolveForCondition(), and verifyPrimKeyFldVal().

00043     {
00044         iter = start;
00045     }

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Mon Jun 9 22:48:25 2008 for csql by  doxygen 1.4.7