QueryCapabilities.h
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.h
22 
23  \brief A class that informs the query support of a given data source.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_QUERYCAPABILITIES_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_QUERYCAPABILITIES_H
28 
29 // TerraLib
30 #include "../../geometry/Enums.h"
31 #include "../Config.h"
32 
33 // STL
34 #include <set>
35 #include <string>
36 
37 namespace te
38 {
39  namespace da
40  {
41  /*!
42  \class QueryCapabilities
43 
44  \brief A class that informs the query support of a given data source.
45 
46  \ingroup dataaccess
47  */
49  {
50  public:
51 
52  /*! \brief Constructor. */
54 
55  /*! \brief Destructor. */
57 
58  public:
59 
60  bool supportsSQLDialect() const;
61 
62  void setSupportSQLDialect(const bool& support);
63 
65 
66  void setSupportSpatialSQLDialect(const bool& support);
67 
68  bool supportsInsert() const;
69 
70  void setSupportInsert(const bool& support);
71 
72  bool supportsUpdate() const;
73 
74  void setSupportUpdate(const bool& support);
75 
76  bool supportsDelete() const;
77 
78  void setSupportDelete(const bool& support);
79 
80  bool supportsCreate() const;
81 
82  void setSupportCreate(const bool& support);
83 
84  bool supportsDrop() const;
85 
86  void setSupportDrop(const bool& support);
87 
88  bool supportsAlter() const;
89 
90  void setSupportAlter(const bool& support);
91 
92  bool supportsSelect() const;
93 
94  void setSupportSelect(const bool& support);
95 
96  bool supportsSelectInto() const;
97 
98  void setSupportSelectInto(const bool& support);
99 
101 
102  const std::set<std::string>& getSpatialOperators() const;
103 
104  void addSpatialOperator(const std::string& op);
105 
106  const std::set<std::string>& getSpatialTopologicOperators() const;
107 
108  void addSpatialTopologicOperator(const std::string& op);
109 
110  const std::set<std::string>& getSpatialMetricOperators() const;
111 
112  void addSpatialMetricOperator(const std::string& op);
113 
114  const std::set<std::string>& getSpatialNewGeomOperators() const;
115 
116  void addSpatialNewGeomOperator(const std::string& op);
117 
118  const std::set<std::string>& getLogicalOperators() const;
119 
120  void addLogicalOperator(const std::string& op);
121 
122  const std::set<std::string>& getComparsionOperators() const;
123 
124  void addComparsionOperator(const std::string& op);
125 
126  const std::set<std::string>& getArithmeticOperators() const;
127 
128  void addArithmeticOperator(const std::string& op);
129 
130  const std::set<std::string>& getFunctions() const;
131 
132  void addFunction(const std::string& op);
133 
134  const std::set<te::gm::GeomType>& getGeometryOperands() const;
135 
137 
138  private:
139 
140  bool m_sqlDialect; //!< A flag that indicates if the data source supports Query API.
141  bool m_spatialSQLDialect; //!< A flag that indicates if the data source supports spatial Query API.
142  bool m_insert; //!< A flag that indicates if the data source supports the INSERT command.
143  bool m_update; //!< A flag that indicates if the data source supports the UPDATE command.
144  bool m_delete; //!< A flag that indicates if the data source supports the DELETE command.
145  bool m_create; //!< A flag that indicates if the data source supports the CREATE command.
146  bool m_drop; //!< A flag that indicates if the data source supports the DROP command.
147  bool m_alter; //!< A flag that indicates if the data source supports the ALTER command.
148  bool m_select; //!< A flag that indicates if the data source supports the SELECT command.
149  bool m_selectInto; //!< A flag that indicates if the data source supports the SELECT INTO command.
150 
151  std::set<std::string> m_spatialTopologicOperators; //!< The names of topological supported operators (touches, crosses, etc).
152  std::set<std::string> m_spatialMetricOperators; //!< The names of spatial metric supported operators (area, lenght, etc).
153  std::set<std::string> m_spatialNewGeomOperators; //!< The names of spatial supported operators that generate new geometries (centroid, buffer, union, intersection,etc).
154  std::set<std::string> m_spatialOperators; //!< The names of other spatial supported operators.
155 
156  std::set<std::string> m_logicalOperators; //!< The names of logical supported operators.
157  std::set<std::string> m_comparsionOperators; //!< The names of comparsion supported operators.
158  std::set<std::string> m_arithmeticOperators; //!< The names of arithmetic supported operators.
159  std::set<std::string> m_functions; //!< The names of supported functions.
160  std::set<te::gm::GeomType> m_geomOperands; //!< The types of geometry supported operands.
161  };
162 
163  } // end namespace da
164 } // end namespace te
165 
166 #endif // __TERRALIB_DATAACCESS_INTERNAL_QUERYCAPABILITIES_H
te::da::QueryCapabilities::QueryCapabilities
QueryCapabilities()
Constructor.
te::da::QueryCapabilities::getSpatialOperators
const std::set< std::string > & getSpatialOperators() const
te::da::QueryCapabilities::m_create
bool m_create
A flag that indicates if the data source supports the CREATE command.
Definition: QueryCapabilities.h:145
te::da::QueryCapabilities::setSupportAlter
void setSupportAlter(const bool &support)
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::da::QueryCapabilities::supportsSelect
bool supportsSelect() const
te::da::QueryCapabilities::m_update
bool m_update
A flag that indicates if the data source supports the UPDATE command.
Definition: QueryCapabilities.h:143
te::da::QueryCapabilities::supportsSQLDialect
bool supportsSQLDialect() const
te::da::QueryCapabilities::setSupportAll
void setSupportAll()
te::da::QueryCapabilities::m_spatialMetricOperators
std::set< std::string > m_spatialMetricOperators
The names of spatial metric supported operators (area, lenght, etc).
Definition: QueryCapabilities.h:152
te::da::QueryCapabilities::m_geomOperands
std::set< te::gm::GeomType > m_geomOperands
The types of geometry supported operands.
Definition: QueryCapabilities.h:160
te::da::QueryCapabilities::supportsInsert
bool supportsInsert() const
te::da::QueryCapabilities::m_alter
bool m_alter
A flag that indicates if the data source supports the ALTER command.
Definition: QueryCapabilities.h:147
te::da::QueryCapabilities::setSupportInsert
void setSupportInsert(const bool &support)
te::da::QueryCapabilities::getSpatialMetricOperators
const std::set< std::string > & getSpatialMetricOperators() const
te::da::QueryCapabilities::supportsCreate
bool supportsCreate() const
te::da::QueryCapabilities::m_drop
bool m_drop
A flag that indicates if the data source supports the DROP command.
Definition: QueryCapabilities.h:146
te::da::QueryCapabilities::addLogicalOperator
void addLogicalOperator(const std::string &op)
te::da::QueryCapabilities::addSpatialTopologicOperator
void addSpatialTopologicOperator(const std::string &op)
te::da::QueryCapabilities::m_functions
std::set< std::string > m_functions
The names of supported functions.
Definition: QueryCapabilities.h:159
te::da::QueryCapabilities::supportsDrop
bool supportsDrop() const
te::da::QueryCapabilities::setSupportSelect
void setSupportSelect(const bool &support)
TEDATAACCESSEXPORT
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
te::da::QueryCapabilities::addComparsionOperator
void addComparsionOperator(const std::string &op)
te::da::QueryCapabilities::m_spatialOperators
std::set< std::string > m_spatialOperators
The names of other spatial supported operators.
Definition: QueryCapabilities.h:154
te::da::QueryCapabilities::setSupportDrop
void setSupportDrop(const bool &support)
te::da::QueryCapabilities::addSpatialNewGeomOperator
void addSpatialNewGeomOperator(const std::string &op)
te::da::QueryCapabilities::supportsSpatialSQLDialect
bool supportsSpatialSQLDialect() const
te::da::QueryCapabilities::getLogicalOperators
const std::set< std::string > & getLogicalOperators() const
te::da::QueryCapabilities::setSupportSQLDialect
void setSupportSQLDialect(const bool &support)
te::da::QueryCapabilities::addGeometryOperand
void addGeometryOperand(const te::gm::GeomType &type)
te::da::QueryCapabilities::setSupportUpdate
void setSupportUpdate(const bool &support)
te::da::QueryCapabilities::addFunction
void addFunction(const std::string &op)
te::da::QueryCapabilities::m_delete
bool m_delete
A flag that indicates if the data source supports the DELETE command.
Definition: QueryCapabilities.h:144
te::da::QueryCapabilities::addSpatialOperator
void addSpatialOperator(const std::string &op)
te::da::QueryCapabilities::~QueryCapabilities
~QueryCapabilities()
Destructor.
te::da::QueryCapabilities::m_selectInto
bool m_selectInto
A flag that indicates if the data source supports the SELECT INTO command.
Definition: QueryCapabilities.h:149
te::da::QueryCapabilities::setSupportCreate
void setSupportCreate(const bool &support)
te::da::QueryCapabilities::m_comparsionOperators
std::set< std::string > m_comparsionOperators
The names of comparsion supported operators.
Definition: QueryCapabilities.h:157
te::da::QueryCapabilities::getSpatialNewGeomOperators
const std::set< std::string > & getSpatialNewGeomOperators() const
te::da::QueryCapabilities::m_spatialSQLDialect
bool m_spatialSQLDialect
A flag that indicates if the data source supports spatial Query API.
Definition: QueryCapabilities.h:141
te::da::QueryCapabilities::getComparsionOperators
const std::set< std::string > & getComparsionOperators() const
te::da::QueryCapabilities::supportsAlter
bool supportsAlter() const
te::da::QueryCapabilities::supportsUpdate
bool supportsUpdate() const
te::da::QueryCapabilities::supportsSelectInto
bool supportsSelectInto() const
te::da::QueryCapabilities::m_sqlDialect
bool m_sqlDialect
A flag that indicates if the data source supports Query API.
Definition: QueryCapabilities.h:140
te::da::QueryCapabilities::addArithmeticOperator
void addArithmeticOperator(const std::string &op)
te::da::QueryCapabilities::setSupportSelectInto
void setSupportSelectInto(const bool &support)
te::da::QueryCapabilities::m_select
bool m_select
A flag that indicates if the data source supports the SELECT command.
Definition: QueryCapabilities.h:148
te::da::QueryCapabilities::getArithmeticOperators
const std::set< std::string > & getArithmeticOperators() const
te::da::QueryCapabilities::m_spatialTopologicOperators
std::set< std::string > m_spatialTopologicOperators
The names of topological supported operators (touches, crosses, etc).
Definition: QueryCapabilities.h:151
te::da::QueryCapabilities::m_arithmeticOperators
std::set< std::string > m_arithmeticOperators
The names of arithmetic supported operators.
Definition: QueryCapabilities.h:158
te::da::QueryCapabilities::m_logicalOperators
std::set< std::string > m_logicalOperators
The names of logical supported operators.
Definition: QueryCapabilities.h:156
te::da::QueryCapabilities::supportsDelete
bool supportsDelete() const
te::da::QueryCapabilities::addSpatialMetricOperator
void addSpatialMetricOperator(const std::string &op)
te::da::QueryCapabilities::m_insert
bool m_insert
A flag that indicates if the data source supports the INSERT command.
Definition: QueryCapabilities.h:142
te::gm::GeomType
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:42
te::da::QueryCapabilities::getFunctions
const std::set< std::string > & getFunctions() const
te::da::QueryCapabilities::getGeometryOperands
const std::set< te::gm::GeomType > & getGeometryOperands() const
te::da::QueryCapabilities::setSupportDelete
void setSupportDelete(const bool &support)
te::da::QueryCapabilities
A class that informs the query support of a given data source.
Definition: QueryCapabilities.h:49
te::da::QueryCapabilities::setSupportSpatialSQLDialect
void setSupportSpatialSQLDialect(const bool &support)
te::da::QueryCapabilities::getSpatialTopologicOperators
const std::set< std::string > & getSpatialTopologicOperators() const
te::da::QueryCapabilities::m_spatialNewGeomOperators
std::set< std::string > m_spatialNewGeomOperators
The names of spatial supported operators that generate new geometries (centroid, buffer,...
Definition: QueryCapabilities.h:153