11/* *
22 * @file RowExecutor.h
33 * @ingroup SQLiteCpp
4- * @brief TODO:
4+ * @brief Step executor for SQLite prepared Statement Object
55 *
66 * Copyright (c) 2015 Shibao HONG (shibaohong@outlook.com)
77 * Copyright (c) 2015-2021 Sebastien Rombauts (sebastien.rombauts@gmail.com)
@@ -130,17 +130,17 @@ class RowExecutor
130130 int getChanges () const noexcept ;
131131
132132 // / Return the number of columns in the result set returned by the prepared statement
133- int getColumnCount () const
133+ int getColumnCount () const noexcept
134134 {
135135 return mColumnCount ;
136136 }
137137 // / true when a row has been fetched with executeStep()
138- bool hasRow () const
138+ bool hasRow () const noexcept
139139 {
140140 return mbHasRow;
141141 }
142142 // / true when the last executeStep() had no more row to fetch
143- bool isDone () const
143+ bool isDone () const noexcept
144144 {
145145 return mbDone;
146146 }
@@ -167,7 +167,10 @@ class RowExecutor
167167 *
168168 * @return raw pointer to Statement Object
169169 */
170- TStatementPtr getStatement () const noexcept ;
170+ TStatementPtr getStatement () const noexcept
171+ {
172+ return mpStatement;
173+ }
171174
172175 /* *
173176 * @brief Return a prepared SQLite Statement Object.
@@ -176,6 +179,19 @@ class RowExecutor
176179 * @return raw pointer to Prepared Statement Object
177180 */
178181 sqlite3_stmt* getPreparedStatement () const ;
182+
183+ /* *
184+ * @brief Return a prepared SQLite Statement Object.
185+ *
186+ * Throw an exception if the statement object was not prepared.
187+ * @return raw pointer to Prepared Statement Object
188+ */
189+ TRowWeakPtr getExecutorWeakPtr () const
190+ {
191+ return mpRowExecutor;
192+ }
193+
194+ // //////////////////////////////////////////////////////////////////////////
179195
180196 /* *
181197 * @brief Check if a return code equals SQLITE_OK, else throw a SQLite::Exception with the SQLite error message
@@ -222,9 +238,13 @@ class RowExecutor
222238 sqlite3* mpSQLite{}; // !< Pointer to SQLite Database Connection Handle
223239 TStatementPtr mpStatement{}; // !< Shared Pointer to the prepared SQLite Statement Object
224240
225- int mColumnCount { 0 }; // !< Number of columns in the result of the prepared statement
226- bool mbHasRow{ false }; // !< true when a row has been fetched with executeStep()
227- bool mbDone{ false }; // !< true when the last executeStep() had no more row to fetch
241+ // / Shared Pointer to this object.
242+ // / Allows RowIterator to execute next step
243+ TRowPtr mpRowExecutor{};
244+
245+ int mColumnCount = 0 ; // !< Number of columns in the result of the prepared statement
246+ bool mbHasRow = false ; // !< true when a row has been fetched with executeStep()
247+ bool mbDone = false ; // !< true when the last executeStep() had no more row to fetch
228248
229249 // / Map of columns index by name (mutable so getColumnIndex can be const)
230250 mutable TColumnsMap mColumnNames {};
0 commit comments