QueryVisitor.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/QueryVisitor.h
22 
23  \brief A visitor interface for the Query hierarchy.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_QUERYVISITOR_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_QUERYVISITOR_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "../query_fw.h"
32 
33 namespace te
34 {
35  namespace da
36  {
37  /*!
38  \class QueryVisitor
39 
40  \brief A visitor interface for the Query hierarchy.
41 
42  The visitor interface can be implemented by data access drivers
43  in order to translate a Query object to its dialect (SELECT, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER).
44 
45  \ingroup dataaccess
46  */
48  {
49  public:
50 
51  /*! \brief Default constructor. */
53 
54  /*! \brief Virtual destructor. */
55  virtual ~QueryVisitor() {}
56 
57  virtual void visit(const Expression& visited) = 0;
58  virtual void visit(const DataSetName& visited) = 0;
59  //virtual void visit(const FromFunctionCall& visited) = 0;
60  virtual void visit(const FromItem& visited) = 0;
61  virtual void visit(const Function& visited) = 0;
62  virtual void visit(const Insert& visited) = 0;
63  virtual void visit(const Join& visited) = 0;
64  virtual void visit(const JoinCondition& visited) = 0;
65  virtual void visit(const JoinConditionOn& visited) = 0;
66  virtual void visit(const JoinConditionUsing& visited) = 0;
67  virtual void visit(const Literal& visited) = 0;
68  virtual void visit(const LiteralBool& visited) = 0;
69  virtual void visit(const LiteralByteArray& visited) = 0;
70  virtual void visit(const LiteralDateTime& visited) = 0;
71  virtual void visit(const LiteralDouble& visited) = 0;
72  virtual void visit(const LiteralEnvelope& visited) = 0;
73  virtual void visit(const LiteralGeom& visited) = 0;
74  virtual void visit(const LiteralInt16& visited) = 0;
75  virtual void visit(const LiteralInt32& visited) = 0;
76  virtual void visit(const LiteralInt64& visited) = 0;
77  virtual void visit(const LiteralString& visited) = 0;
78  virtual void visit(const PropertyName& visited) = 0;
79  virtual void visit(const Query& visited) = 0;
80  virtual void visit(const Select& visited) = 0;
81  virtual void visit(const SelectExpression& visited) = 0;
82  virtual void visit(const SubSelect& visited) = 0;
83  virtual void visit(const In& visited) = 0;
84  };
85 
86  } // end namespace da
87 } // end namespace te
88 
89 
90 #endif // __TERRALIB_DATAACCESS_INTERNAL_QUERYVISITOR_H
91 
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:43
A class that models the name of any property of an object.
Definition: PropertyName.h:50
This class models a bool Literal value.
Definition: LiteralBool.h:43
The Insert object can add the return of a select object.
Definition: Insert.h:50
This is an abstract class that models a query expression.
Definition: Expression.h:47
A class that models a literal for Date and Time values.
QueryVisitor()
Default constructor.
Definition: QueryVisitor.h:52
A visitor interface for the Query hierarchy.
Definition: QueryVisitor.h:47
This class models a literal value.
Definition: Literal.h:53
URI C++ Library.
A class that models a literal for ByteArray values.
A condition to be used in a Join clause.
Definition: JoinCondition.h:44
virtual ~QueryVisitor()
Virtual destructor.
Definition: QueryVisitor.h:55
A class that models a Function expression.
Definition: Function.h:47
A Join clause combines two FromItems.
Definition: Join.h:50
A class that models a literal for double values.
Definition: LiteralDouble.h:43
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
A Select can be used as a source of information in another query.
JoinConditionUsing class can be used to model a USING clause in a Join.
A class that models a literal for Envelope values.
A class that represents the IN operator.
Definition: In.h:52
JoinConditionOn is a boolean expression and it specifies which items in a join are considered to matc...
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
A Select can be used as a source of information in another query.
Definition: SubSelect.h:49
A Query is independent from the data source language/dialect.
Definition: Query.h:46
A class that models a literal for Geometry values.
Definition: LiteralGeom.h:46
This class models a string Literal value.
Definition: LiteralString.h:46