MySQL Connector/C++
MySQL connector library for C and C++ applications
|
Result of an operation that returns documents. More...
Public Member Functions | |
DbDoc | fetchOne () |
Return the current document and move to the next one in the sequence. More... | |
DocList | fetchAll () |
Return all remaining documents. More... | |
uint64_t | count () |
Returns the number of documents contained in the result. More... | |
unsigned | getWarningsCount () const |
Get the number of warnings stored in the result. | |
WarningList | getWarnings () |
Get a list of warnings stored in the result. | |
Warning | getWarning (unsigned pos) |
Get the warning at the given, 0-based position. | |
uint64_t | getAffectedItemsCount () const |
Get the count of affected items (rows or doucuments) from manipulation statements. | |
Result of an operation that returns documents.
A DocResult
object gives sequential access to the documents contained in the result. It is possible to get the documents one-by-one, or fetch and store all of them at once. One can iterate over the documents using range loop: for (DbDoc d : result) ...
.
DocResult
object should be used by at most one thread at a time. It is not safe to call its methods by several threads simultaneously. It is responsibility of the user to ensure this using a synchronization mechanism such as mutexes.
|
inline |
Return the current document and move to the next one in the sequence.
If there are no more documents in this result, returns a null document.
|
inline |
Return all remaining documents.
Result of this method can be stored in a container such as std::list<DbDoc>
. Documents that have already been fetched using fetchOne()
are not included in the result of fetchAll()
.
|
inline |
Returns the number of documents contained in the result.
The method counts only the documents that were not yet fetched and are still available in the result.