Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsqlcachedresult_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSQLCACHEDRESULT_P_H
5#define QSQLCACHEDRESULT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtSql/private/qtsqlglobal_p.h>
19#include "QtSql/qsqlresult.h"
20#include "QtSql/private/qsqlresult_p.h"
21#include <QtCore/qcontainerfwd.h>
22
24
25class QVariant;
26
28
29class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
30{
31 Q_DECLARE_PRIVATE(QSqlCachedResult)
32
33public:
34 typedef QList<QVariant> ValueCache;
35
36protected:
38
39 void init(int colCount);
40 void cleanup();
41 void clearValues();
42
43 virtual bool gotoNext(ValueCache &values, int index) = 0;
44
45 QVariant data(int i) override;
46 bool isNull(int i) override;
47 bool fetch(int i) override;
48 bool fetchNext() override;
49 bool fetchPrevious() override;
50 bool fetchFirst() override;
51 bool fetchLast() override;
52
53 int colCount() const;
55
56 void virtual_hook(int id, void *data) override;
57 void detachFromResultSet() override;
58 void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) override;
59private:
60 bool cacheNext();
61};
62
64{
65 Q_DECLARE_PUBLIC(QSqlCachedResult)
66
67public:
69
70 bool canSeek(int i) const;
71 inline int cacheCount() const;
72 void init(int count, bool fo);
73 void cleanup();
74 int nextIndex();
75 void revertLast();
76
78 int rowCacheEnd = 0;
79 int colCount = 0;
80 bool atEnd = false;
81};
82
84
85#endif // QSQLCACHEDRESULT_P_H
QSqlCachedResult::ValueCache cache
QList< QVariant > ValueCache
virtual bool gotoNext(ValueCache &values, int index)=0
QSqlResultPrivate(QSqlResult *q, const QSqlDriver *drv)
The QSqlResult class provides an abstract interface for accessing data from specific SQL databases.
Definition qsqlresult.h:22
\inmodule QtCore
Definition qvariant.h:65
QCache< int, Employee > cache
[0]
NumericalPrecisionPolicy
Definition qtsqlglobal.h:43
Combined button and popup list for selecting options.
GLenum GLsizei GLsizei GLint * values
[15]
GLuint index
[2]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QSizePolicy policy