All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QueryCapabilities.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/dataaccess/query/QueryCapabilities.cpp
22 
23  \brief A class that informs the query support of a given data source.
24 */
25 
26 // TerraLib
27 #include "QueryCapabilities.h"
28 
30  : m_sqlDialect(false),
31  m_spatialSQLDialect(false),
32  m_insert(false),
33  m_update(false),
34  m_delete(false),
35  m_create(false),
36  m_drop(false),
37  m_alter(false),
38  m_select(false),
39  m_selectInto(false)
40 {
41 }
42 
44 {
45 }
46 
48 {
49  return m_sqlDialect;
50 }
51 
53 {
54  m_sqlDialect = support;
55 }
56 
58 {
59  return m_spatialSQLDialect;
60 }
61 
63 {
64  m_spatialSQLDialect = support;
65 }
66 
68 {
69  return m_insert;
70 }
71 
73 {
74  m_insert = support;
75 }
76 
78 {
79  return m_update;
80 }
81 
83 {
84  m_update = support;
85 }
86 
88 {
89  return m_delete;
90 }
91 
93 {
94  m_delete = support;
95 }
96 
98 {
99  return m_create;
100 }
101 
103 {
104  m_create = support;
105 }
106 
108 {
109  return m_drop;
110 }
111 
113 {
114  m_drop = support;
115 }
116 
118 {
119  return m_alter;
120 }
121 
123 {
124  m_alter = support;
125 }
126 
128 {
129  return m_select;
130 }
131 
133 {
134  m_select = support;
135 }
136 
138 {
139  return m_selectInto;
140 }
141 
143 {
144  m_selectInto = support;
145 }
146 
148 {
149  m_sqlDialect = true;
150  m_spatialSQLDialect = true;
151  m_insert = true;
152  m_update = true;
153  m_delete = true;
154  m_create = true;
155  m_drop = true;
156  m_alter = true;
157  m_select = true;
158  m_selectInto = true;
159 }
160 
161 const std::set<std::string>& te::da::QueryCapabilities::getSpatialOperators() const
162 {
163  return m_spatialOperators;
164 }
165 
167 {
168  m_spatialOperators.insert(op);
169 }
170 
172 {
173  return m_spatialTopologicOperators;
174 }
175 
177 {
178  m_spatialTopologicOperators.insert(op);
179 }
180 
181 const std::set<std::string>& te::da::QueryCapabilities::getSpatialMetricOperators() const
182 {
183  return m_spatialMetricOperators;
184 }
185 
187 {
188  m_spatialMetricOperators.insert(op);
189 }
190 
191 const std::set<std::string>& te::da::QueryCapabilities::getSpatialNewGeomOperators() const
192 {
193  return m_spatialNewGeomOperators;
194 }
195 
197 {
198  m_spatialNewGeomOperators.insert(op);
199 }
200 
201 const std::set<std::string>& te::da::QueryCapabilities::getLogicalOperators() const
202 {
203  return m_logicalOperators;
204 }
205 
207 {
208  m_logicalOperators.insert(op);
209 }
210 
211 const std::set<std::string>& te::da::QueryCapabilities::getComparsionOperators() const
212 {
213  return m_comparsionOperators;
214 }
215 
217 {
218  m_comparsionOperators.insert(op);
219 }
220 
221 const std::set<std::string>& te::da::QueryCapabilities::getArithmeticOperators() const
222 {
223  return m_arithmeticOperators;
224 }
225 
227 {
228  m_arithmeticOperators.insert(op);
229 }
230 
231 const std::set<std::string>& te::da::QueryCapabilities::getFunctions() const
232 {
233  return m_functions;
234 }
235 
236 void te::da::QueryCapabilities::addFunction(const std::string& op)
237 {
238  m_functions.insert(op);
239 }
240 
241 const std::set<te::gm::GeomType>& te::da::QueryCapabilities::getGeometryOperands() const
242 {
243  return m_geomOperands;
244 }
245 
247 {
248  m_geomOperands.insert(type);
249 }
const std::set< std::string > & getComparsionOperators() const
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
void setSupportAlter(const bool &support)
void setSupportSpatialSQLDialect(const bool &support)
const std::set< std::string > & getSpatialMetricOperators() const
void addSpatialTopologicOperator(const std::string &op)
void setSupportSelect(const bool &support)
void addComparsionOperator(const std::string &op)
const std::set< std::string > & getFunctions() const
const std::set< std::string > & getArithmeticOperators() const
void addSpatialNewGeomOperator(const std::string &op)
void setSupportInsert(const bool &support)
void addLogicalOperator(const std::string &op)
void setSupportCreate(const bool &support)
const std::set< std::string > & getLogicalOperators() const
const std::set< te::gm::GeomType > & getGeometryOperands() const
void addSpatialOperator(const std::string &op)
void setSupportSelectInto(const bool &support)
void setSupportDrop(const bool &support)
void addGeometryOperand(const te::gm::GeomType &type)
const std::set< std::string > & getSpatialNewGeomOperators() const
const std::set< std::string > & getSpatialOperators() const
bool supportsSpatialSQLDialect() const
void setSupportSQLDialect(const bool &support)
void setSupportUpdate(const bool &support)
void addFunction(const std::string &op)
const std::set< std::string > & getSpatialTopologicOperators() const
void addArithmeticOperator(const std::string &op)
void addSpatialMetricOperator(const std::string &op)
void setSupportDelete(const bool &support)
A class that informs the query support of a given data source.