VTK
vtkQtSQLQuery.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkQtSQLQuery.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
28#ifndef vtkQtSQLQuery_h
29#define vtkQtSQLQuery_h
30
31// Check for Qt SQL module before defining this class.
32#include <qglobal.h> // Needed to check if SQL is available
33#if (QT_EDITION & QT_MODULE_SQL)
34
35#include "vtkGUISupportQtSQLModule.h" // For export macro
36#include "vtkSQLQuery.h"
37
38class vtkVariant;
39class vtkQtSQLQueryInternals;
40
41class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery
42{
43public:
44 static vtkQtSQLQuery* New();
45 vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery);
46 void PrintSelf(ostream& os, vtkIndent indent);
47
53 virtual bool Execute();
54
58 virtual int GetNumberOfFields();
59
63 virtual const char* GetFieldName(int col);
64
68 virtual int GetFieldType(int col);
69
73 virtual bool NextRow();
74
79
83 virtual bool HasError();
84
88 virtual const char* GetLastErrorText();
89
90protected:
93
94 vtkQtSQLQueryInternals* Internals;
95 friend class vtkQtSQLDatabase;
96
97private:
98
99 // Using the convenience function internally
100 vtkSetStringMacro(LastErrorText);
101
102 char* LastErrorText;
103
104 vtkQtSQLQuery(const vtkQtSQLQuery &) VTK_DELETE_FUNCTION;
105 void operator=(const vtkQtSQLQuery &) VTK_DELETE_FUNCTION;
106};
107
108#endif // (QT_EDITION & QT_MODULE_SQL)
109#endif // vtkQtSQLQuery_h
110
a simple class to control print indentation
Definition: vtkIndent.h:40
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
maintains a connection to an sql database
query class associated with vtkQtSQLDatabase
virtual int GetNumberOfFields()=0
The number of fields in the query result.
virtual vtkVariant DataValue(vtkIdType c)=0
Return data in current row, field c.
virtual bool NextRow()=0
Advance row, return false if past end.
virtual const char * GetFieldName(int i)=0
Return the name of the specified query field.
virtual int GetFieldType(int i)=0
Return the type of the field, using the constants defined in vtkType.h.
virtual bool HasError()=0
Returns true if an error is set, otherwise false.
virtual const char * GetLastErrorText()=0
Get the last error text from the query.
executes an sql query and retrieves results
Definition: vtkSQLQuery.h:75
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual bool Execute()=0
Execute the query.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
int vtkIdType
Definition: vtkType.h:287