VTK
vtkPostgreSQLQuery.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPostgreSQLQuery.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 -------------------------------------------------------------------------*/
38 #ifndef __vtkPostgreSQLQuery_h
39 #define __vtkPostgreSQLQuery_h
40 
41 #include "vtkSQLQuery.h"
42 
44 class vtkVariant;
45 class vtkVariantArray;
46 class vtkPostgreSQLQueryPrivate;
47 
49 {
50 public:
51  static vtkPostgreSQLQuery* New();
52  void PrintSelf( ostream& os, vtkIndent indent );
54 
57  bool Execute();
58 
60  int GetNumberOfFields();
61 
63  const char* GetFieldName( int i );
64 
67  int GetFieldType( int i );
68 
70  bool NextRow();
71 
73  bool HasError();
74 
76 
77  bool BeginTransaction();
78  bool RollbackTransaction();
79  bool CommitTransaction();
81 
84 
86  const char* GetLastErrorText();
87 
89  virtual vtkStdString EscapeString( vtkStdString s, bool addSurroundingQuotes = true );
90 
93  int GetNumberOfRows();
94 
95 protected:
98 
99  vtkSetStringMacro(LastErrorText);
100 
101  bool IsColumnBinary(int whichColumn);
102  const char *GetColumnRawData(int whichColumn);
103 
107 
108  vtkPostgreSQLQueryPrivate *QueryInternals;
109 
110  void DeleteQueryResults();
111 
112  //BTX
113  friend class vtkPostgreSQLDatabase;
114  //ETX
115 
116 private:
117  vtkPostgreSQLQuery( const vtkPostgreSQLQuery& ); // Not implemented.
118  void operator = ( const vtkPostgreSQLQuery& ); // Not implemented.
119 };
120 
121 #endif // __vtkPostgreSQLQuery_h
122 
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
virtual bool NextRow()=0
An array holding vtkVariants.
maintain a connection to a PostgreSQL database
virtual const char * GetFieldName(int i)=0
virtual bool CommitTransaction()
Definition: vtkSQLQuery.h:99
int vtkIdType
Definition: vtkType.h:255
void PrintSelf(ostream &os, vtkIndent indent)
virtual vtkStdString EscapeString(vtkStdString s, bool addSurroundingQuotes=true)
A atomic type representing the union of many types.
Definition: vtkVariant.h:72
virtual bool HasError()=0
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkSQLQuery implementation for PostgreSQL databases
virtual int GetNumberOfFields()=0
virtual bool RollbackTransaction()
Definition: vtkSQLQuery.h:100
virtual bool BeginTransaction()
Definition: vtkSQLQuery.h:98
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:72
virtual const char * GetLastErrorText()=0
#define VTK_IO_EXPORT
static vtkObject * New()
vtkPostgreSQLQueryPrivate * QueryInternals