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 -------------------------------------------------------------------------*/
27 #ifndef vtkQtSQLQuery_h
28 #define vtkQtSQLQuery_h
29 
30 // Check for Qt SQL module before defining this class.
31 #include <qglobal.h>
32 #if (QT_EDITION & QT_MODULE_SQL)
33 
34 #include "vtkGUISupportQtSQLModule.h"
35 #include "vtkSQLQuery.h"
36 #include "vtkType.h"
37 
38 class vtkVariant;
39 class vtkQtSQLQueryInternals;
40 
41 class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery
42 {
43 public:
44  static vtkQtSQLQuery* New();
45  vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery);
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
50  virtual bool Execute();
51 
53  virtual int GetNumberOfFields();
54 
56  virtual const char* GetFieldName(int col);
57 
60  virtual int GetFieldType(int col);
61 
63  virtual bool NextRow();
64 
66  virtual vtkVariant DataValue(vtkIdType c);
67 
69  virtual bool HasError();
70 
72  virtual const char* GetLastErrorText();
73 
74 protected:
75  vtkQtSQLQuery();
76  ~vtkQtSQLQuery();
77 
78  vtkQtSQLQueryInternals* Internals;
79  friend class vtkQtSQLDatabase;
80 
81 private:
82 
83  // Using the convenience function internally
84  vtkSetStringMacro(LastErrorText);
85 
86  char* LastErrorText;
87 
88  vtkQtSQLQuery(const vtkQtSQLQuery &); // Not implemented.
89  void operator=(const vtkQtSQLQuery &); // Not implemented.
90 };
91 
92 #endif // (QT_EDITION & QT_MODULE_SQL)
93 #endif // vtkQtSQLQuery_h
94 
virtual bool NextRow()=0
virtual const char * GetFieldName(int i)=0
int vtkIdType
Definition: vtkType.h:275
void PrintSelf(ostream &os, vtkIndent indent)
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
virtual bool HasError()=0
query class associated with vtkQtSQLDatabase
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int GetNumberOfFields()=0
virtual int GetFieldType(int i)=0
virtual bool Execute()=0
virtual vtkVariant DataValue(vtkIdType c)=0
executes an sql query and retrieves results
Definition: vtkSQLQuery.h:73
virtual const char * GetLastErrorText()=0
static vtkObject * New()
maintains a connection to an sql database