SQLitePP::ResultIterator Class Reference

Class for iterating over the result of a database query. More...

#include <sqlitepp.h>

List of all members.

Public Member Functions

 ResultIterator (sqlite3_stmt *stmt)
 Constructor.
 ~ResultIterator ()
bool hasMoreRows ()
 Returns true if there are more results. False otherwise.
void next ()
 Steps to the result.
template<typename T>
get (int column)
 Get the current result. template parameter T needs to be of one of the following types: int, unsigned, const char*, Blob, std::string, PhraseHunter::UnicodePtr.

Private Attributes

sqlite3_stmt * m_stmt
int state


Detailed Description

Class for iterating over the result of a database query.

Definition at line 52 of file sqlitepp.h.


Constructor & Destructor Documentation

SQLitePP::ResultIterator::ResultIterator ( sqlite3_stmt *  stmt  )  [inline]

Constructor.

Parameters:
stmt The Statement containing the sql query.

Definition at line 63 of file sqlitepp.h.

References next().

SQLitePP::ResultIterator::~ResultIterator (  )  [inline]

Definition at line 68 of file sqlitepp.h.

References m_stmt.


Member Function Documentation

bool SQLitePP::ResultIterator::hasMoreRows (  )  [inline]

Returns true if there are more results. False otherwise.

Definition at line 73 of file sqlitepp.h.

References state.

Referenced by PhraseHunter::IndexManager::addToIndex(), PhraseHunter::CorpusManager::documentName(), PhraseHunter::StatisticsEngine::getCandidates(), PhraseHunter::CorpusToken::insertPositions(), SQLitePP::Statement::queryScalar(), PhraseHunter::LightCorpusToken::search(), and PhraseHunter::SearchEngine::searchToken().

void SQLitePP::ResultIterator::next (  )  [inline]

Steps to the result.

Definition at line 78 of file sqlitepp.h.

References m_stmt, p_assert, and state.

Referenced by PhraseHunter::CorpusToken::insertPositions(), and ResultIterator().

schma::UnicodePtr SQLitePP::ResultIterator::get< schma::UnicodePtr > ( int  column  )  [inline]

Get the current result. template parameter T needs to be of one of the following types: int, unsigned, const char*, Blob, std::string, PhraseHunter::UnicodePtr.

Parameters:
column The column in the result table.

Definition at line 89 of file sqlitepp.h.

Referenced by PhraseHunter::IndexManager::addToIndex(), PhraseHunter::CorpusManager::documentName(), PhraseHunter::StatisticsEngine::getCandidates(), PhraseHunter::CorpusToken::insertPositions(), PhraseHunter::StatisticsEngine::overallFrequency(), SQLitePP::Statement::queryScalar(), PhraseHunter::StatisticsEngine::rank(), PhraseHunter::LightCorpusToken::search(), PhraseHunter::SearchEngine::searchToken(), and PhraseHunter::StatisticsEngine::StatisticsEngine().


Member Data Documentation

sqlite3_stmt* SQLitePP::ResultIterator::m_stmt [private]

Definition at line 55 of file sqlitepp.h.

Referenced by next(), and ~ResultIterator().

int SQLitePP::ResultIterator::state [private]

Definition at line 56 of file sqlitepp.h.

Referenced by hasMoreRows(), and next().


The documentation for this class was generated from the following files:
Generated on Thu Dec 21 16:14:44 2006 for The Phrasehunter by  doxygen 1.5.1