Loading...
Searching...
No Matches
SQLVisitor.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/ogr/SQLVisitor.h
22
23 \brief A visitor for building an SQL statement using OGR dialect.
24*/
25
26#ifndef __TERRALIB_OGR_INTERNAL_SQLVISITOR_H
27#define __TERRALIB_OGR_INTERNAL_SQLVISITOR_H
28
29// TerraLib
30#include "../dataaccess/query/SQLVisitor.h"
31#include "Config.h"
32
33namespace te
34{
35 namespace gm
36 {
37 // Forward declaration
38 class Envelope;
39 }
40
41 namespace ogr
42 {
43 /*!
44 \class SQLVisitor
45
46 \brief A visitor for building an SQL statement from a given Query hierarchy - OGR Driver
47
48 NOTE: When the DISTINCT keyword is used, only one attribute may appear in the field list.
49
50 */
51
53 {
54 public:
55 /*! \brief Default constructor. */
57 const te::da::SQLDialect& dialect,
58 std::string& sql,
59 const std::string& driverName );
60
61 /*! \brief Destructor. */
63
64 void visit(const te::da::DataSetName& visited);
65
66 void visit(const te::da::LiteralEnvelope& visited);
67
68 void visit(const te::da::PropertyName& visited);
69
70 void visit(const te::da::Select& visited);
71
72 void visit(const te::da::Join& visited);
73
74 void visit(const te::da::JoinConditionOn& visited);
75
76 void visit(const te::da::LiteralBool& visited) override;
77
78 void visit(const te::da::LiteralString& visited) override;
79
80 void visit(const te::da::LiteralGeom& visited) override;
81
82 void visit(const te::da::LiteralDateTime& visited) override;
83
84 void visit(const te::da::In& visited) override;
85
87
88 protected:
89
91 std::string m_driverName;
92 };
93 }
94}
95
96
97#endif //__TERRALIB_OGR_INTERNAL_SQLVISITOR_H
A class that models the name of a dataset used in a From clause.
Definition DataSetName.h:44
A class that represents the IN operator.
Definition In.h:53
JoinConditionOn is a boolean expression and it specifies which items in a join are considered to matc...
A Join clause combines two FromItems.
Definition Join.h:51
This class models a bool Literal value.
Definition LiteralBool.h:44
A class that models a literal for Date and Time values.
A class that models a literal for Envelope values.
A class that models a literal for Geometry values.
Definition LiteralGeom.h:47
This class models a string Literal value.
A class that models the name of any property of an object.
It represents the SQL query dialect accepted by a given data source.
Definition SQLDialect.h:56
A visitor for building an SQL statement from a given Query hierarchy.
Definition SQLVisitor.h:59
A Select models a query to be used when retrieving data from a DataSource.
Definition Select.h:67
An Envelope defines a 2D rectangular region.
Definition Envelope.h:52
A visitor for building an SQL statement from a given Query hierarchy - OGR Driver.
Definition SQLVisitor.h:53
void visit(const te::da::Join &visited)
void visit(const te::da::LiteralGeom &visited) override
void visit(const te::da::In &visited) override
te::gm::Envelope * getMBR()
~SQLVisitor()
Destructor.
Definition SQLVisitor.h:62
void visit(const te::da::LiteralEnvelope &visited)
te::gm::Envelope * m_bbox
Definition SQLVisitor.h:90
void visit(const te::da::LiteralBool &visited) override
void visit(const te::da::PropertyName &visited)
void visit(const te::da::JoinConditionOn &visited)
void visit(const te::da::LiteralString &visited) override
void visit(const te::da::Select &visited)
void visit(const te::da::LiteralDateTime &visited) override
void visit(const te::da::DataSetName &visited)
SQLVisitor(const te::da::SQLDialect &dialect, std::string &sql, const std::string &driverName)
Default constructor.
std::string m_driverName
Definition SQLVisitor.h:91
TerraLib.
#define TEOGREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:79
Proxy configuration file for TerraView (see terraview_config.h).