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 
33 namespace 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. */
56  SQLVisitor(const te::da::SQLDialect& dialect, std::string& sql);
57 
58  /*! \brief Destructor. */
60 
61  void visit(const te::da::DataSetName& visited);
62 
63  void visit(const te::da::LiteralEnvelope& visited);
64 
65  void visit(const te::da::PropertyName& visited);
66 
67  void visit(const te::da::Select& visited);
68 
69  void visit(const te::da::Join& visited);
70 
71  void visit(const te::da::JoinConditionOn& visited);
72 
73  te::gm::Envelope* getMBR();
74 
75  protected:
76 
78  };
79  }
80 }
81 
82 
83 #endif //__TERRALIB_OGR_INTERNAL_SQLVISITOR_H
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:43
te::gm::Envelope * m_bbox
Definition: SQLVisitor.h:77
A class that models the name of any property of an object.
Definition: PropertyName.h:50
A visitor for building an SQL statement from a given Query hierarchy - OGR Driver.
Definition: SQLVisitor.h:52
#define TEOGREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:79
It represents the SQL query dialect accepted by a given data source.
Definition: SQLDialect.h:55
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
TerraLib.
A Join clause combines two FromItems.
Definition: Join.h:50
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
Configuration flags for the OGR Driver Implementation of TerraLib.
A class that models a literal for Envelope values.
A visitor for building an SQL statement from a given Query hierarchy.
Definition: SQLVisitor.h:58
JoinConditionOn is a boolean expression and it specifies which items in a join are considered to matc...
~SQLVisitor()
Destructor.
Definition: SQLVisitor.h:59