#ifndef QSQLCACHEDRESULT_P_H<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
#define QSQLCACHEDRESULT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
// 该类不是qt api的一部分。它的存在是为了其他qt类的方便。这个头文件可能改变而不通知,甚至被删除。
// We mean it.
//
#include "QtSql/qsqlresult.h"
QT_BEGIN_NAMESPACE //开始定义命名空间
class QVariant;
template <typename T> class QVector; //总用这些个复杂的用法,模板
class QSqlCachedResultPrivate;
class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult //sql查询结果缓存。
{
public:
virtual ~QSqlCachedResult();
typedef QVector<QVariant> ValueCache;
protected:
QSqlCachedResult(const QSqlDriver * db); //受保护的构造函数(特殊)
void init(int colCount);
void cleanup();
void clearValues();
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();
int colCount() const;
ValueCache &cache();
void virtual_hook(int id, void *data);
private:
bool cacheNext();
QSqlCachedResultPrivate *d;
};
QT_END_NAMESPACE
#endif // QSQLCACHEDRESULT_P_H
转载于:https://blog.51cto.com/no001/344838