Belle II Software light-2406-ragdoll
ObjectStatement< ObjectType, Columns >::iterator Class Reference

Iterator class to allow iterating over the rows. More...

#include <sqlite.h>

Inheritance diagram for ObjectStatement< ObjectType, Columns >::iterator:
Collaboration diagram for ObjectStatement< ObjectType, Columns >::iterator:

Public Member Functions

 iterator ()=default
 with a default constructor
 
 iterator (ObjectStatement *instance)
 and a real constructor to a statement
 
iteratoroperator++ ()
 increment to next row, stop in case we are done
 
iterator operator++ (int)
 also postfix increment
 
bool operator== (const iterator &other) const
 and equality check
 
bool operator!= (const iterator &other) const
 as well as unequality check
 
value_type operator* () const
 and a dereference operator
 

Private Attributes

ObjectStatementm_instance {nullptr}
 pointer to the statement
 
int64_t m_row { -1}
 current row index
 

Detailed Description

template<class ObjectType, class ... Columns>
class sqlite::ObjectStatement< ObjectType, Columns >::iterator

Iterator class to allow iterating over the rows.

Definition at line 200 of file sqlite.h.

Constructor & Destructor Documentation

◆ iterator()

iterator ( ObjectStatement instance)
inlineexplicit

and a real constructor to a statement

Definition at line 205 of file sqlite.h.

205 : m_instance(instance), m_row{0}
206 {
207 (*this)++;
208 }
ObjectStatement * m_instance
pointer to the statement
Definition: sqlite.h:227
int64_t m_row
current row index
Definition: sqlite.h:229

Member Function Documentation

◆ operator!=()

bool operator!= ( const iterator other) const
inline

as well as unequality check

Definition at line 222 of file sqlite.h.

222{ return m_row != other.m_row; }

◆ operator*()

value_type operator* ( ) const
inline

and a dereference operator

Definition at line 224 of file sqlite.h.

224{ return m_instance->getRow(); }
value_type getRow() const
Return the current row.
Definition: sqlite.h:277

◆ operator++() [1/2]

iterator & operator++ ( )
inline

increment to next row, stop in case we are done

Definition at line 210 of file sqlite.h.

211 {
212 if (m_row < 0) return *this;
213 ++m_row;
214 if (!m_instance->step()) m_row = -1;
215 return *this;
216 }
bool step()
Step to the next row in the result.
Definition: sqlite.h:267

◆ operator++() [2/2]

iterator operator++ ( int  )
inline

also postfix increment

Definition at line 218 of file sqlite.h.

218{iterator retval = *this; ++(*this); return retval;}
iterator()=default
with a default constructor

◆ operator==()

bool operator== ( const iterator other) const
inline

and equality check

Definition at line 220 of file sqlite.h.

220{ return m_row == other.m_row; }

Member Data Documentation

◆ m_instance

ObjectStatement* m_instance {nullptr}
private

pointer to the statement

Definition at line 227 of file sqlite.h.

◆ m_row

int64_t m_row { -1}
private

current row index

Definition at line 229 of file sqlite.h.


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