summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlcachedresult_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/kernel/qsqlcachedresult_p.h')
-rw-r--r--src/sql/kernel/qsqlcachedresult_p.h47
1 files changed, 33 insertions, 14 deletions
diff --git a/src/sql/kernel/qsqlcachedresult_p.h b/src/sql/kernel/qsqlcachedresult_p.h
index 798de01f63..a24964bfb2 100644
--- a/src/sql/kernel/qsqlcachedresult_p.h
+++ b/src/sql/kernel/qsqlcachedresult_p.h
@@ -46,6 +46,7 @@
//
#include "QtSql/qsqlresult.h"
+#include "QtSql/private/qsqlresult_p.h"
QT_BEGIN_NAMESPACE
@@ -56,13 +57,13 @@ class QSqlCachedResultPrivate;
class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
{
-public:
- virtual ~QSqlCachedResult();
+ Q_DECLARE_PRIVATE(QSqlCachedResult)
+public:
typedef QVector<QVariant> ValueCache;
protected:
- QSqlCachedResult(const QSqlDriver * db);
+ QSqlCachedResult(QSqlCachedResultPrivate &d);
void init(int colCount);
void cleanup();
@@ -70,23 +71,41 @@ protected:
virtual bool gotoNext(ValueCache &values, int index) = 0;
- QVariant data(int i);
- bool isNull(int i);
- bool fetch(int i);
- bool fetchNext();
- bool fetchPrevious();
- bool fetchFirst();
- bool fetchLast();
+ QVariant data(int i) Q_DECL_OVERRIDE;
+ bool isNull(int i) Q_DECL_OVERRIDE;
+ bool fetch(int i) Q_DECL_OVERRIDE;
+ bool fetchNext() Q_DECL_OVERRIDE;
+ bool fetchPrevious() Q_DECL_OVERRIDE;
+ bool fetchFirst() Q_DECL_OVERRIDE;
+ bool fetchLast() Q_DECL_OVERRIDE;
int colCount() const;
ValueCache &cache();
- void virtual_hook(int id, void *data);
- void detachFromResultSet();
- void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy);
+ void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ void detachFromResultSet() Q_DECL_OVERRIDE;
+ void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) Q_DECL_OVERRIDE;
private:
bool cacheNext();
- QSqlCachedResultPrivate *d;
+};
+
+class Q_SQL_EXPORT QSqlCachedResultPrivate: public QSqlResultPrivate
+{
+ Q_DECLARE_PUBLIC(QSqlCachedResult)
+
+public:
+ QSqlCachedResultPrivate(QSqlCachedResult *q, const QSqlDriver *drv);
+ bool canSeek(int i) const;
+ inline int cacheCount() const;
+ void init(int count, bool fo);
+ void cleanup();
+ int nextIndex();
+ void revertLast();
+
+ QSqlCachedResult::ValueCache cache;
+ int rowCacheEnd;
+ int colCount;
+ bool atEnd;
};
QT_END_NAMESPACE