VTK  9.3.0
vtkRowQuery.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
37 #ifndef vtkRowQuery_h
38 #define vtkRowQuery_h
39 
40 #include "vtkIOSQLModule.h" // For export macro
41 #include "vtkObject.h"
42 
43 VTK_ABI_NAMESPACE_BEGIN
44 class vtkVariant;
45 class vtkVariantArray;
46 
47 class VTKIOSQL_EXPORT vtkRowQuery : public vtkObject
48 {
49 public:
50  vtkTypeMacro(vtkRowQuery, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
58  virtual bool Execute() = 0;
59 
63  virtual int GetNumberOfFields() = 0;
64 
68  virtual const char* GetFieldName(int i) = 0;
69 
73  virtual int GetFieldType(int i) = 0;
74 
80  int GetFieldIndex(const char* name);
81 
85  virtual bool NextRow() = 0;
86 
92  virtual bool IsActive() = 0;
93 
98  bool NextRow(vtkVariantArray* rowArray);
99 
104 
108  virtual bool HasError() = 0;
109 
113  virtual const char* GetLastErrorText() = 0;
114 
116 
124  vtkSetMacro(CaseSensitiveFieldNames, bool);
125  vtkGetMacro(CaseSensitiveFieldNames, bool);
126  vtkBooleanMacro(CaseSensitiveFieldNames, bool);
128 
129 protected:
131  ~vtkRowQuery() override;
133 
134 private:
135  vtkRowQuery(const vtkRowQuery&) = delete;
136  void operator=(const vtkRowQuery&) = delete;
137 };
138 
139 VTK_ABI_NAMESPACE_END
140 #endif // vtkRowQuery_h
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
abstract interface for queries that return row-oriented results.
Definition: vtkRowQuery.h:48
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetLastErrorText()=0
Get the last error text from the query.
virtual int GetNumberOfFields()=0
The number of fields in the query result.
~vtkRowQuery() override
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 bool IsActive()=0
Return true if the query is active (i.e.
virtual int GetFieldType(int i)=0
Return the type of the field, using the constants defined in vtkType.h.
bool NextRow(vtkVariantArray *rowArray)
Advance row, return false if past end.
virtual bool Execute()=0
Execute the query.
bool CaseSensitiveFieldNames
Definition: vtkRowQuery.h:132
int GetFieldIndex(const char *name)
Return the index of the specified query field.
virtual bool HasError()=0
Returns true if an error is set, otherwise false.
An array holding vtkVariants.
A type representing the union of many types.
Definition: vtkVariant.h:62
@ name
Definition: vtkX3D.h:219
int vtkIdType
Definition: vtkType.h:315