Visitor.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 Visitor.h
22 
23  \brief A visitor interface for a Filter expression.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_VISITOR_H
27 #define __TERRALIB_FE_INTERNAL_VISITOR_H
28 
29 // TerraLib
30 #include "../fe_fw.h"
31 #include "Config.h"
32 
33 namespace te
34 {
35  namespace fe
36  {
37  /*!
38  \class Visitor
39 
40  \brief A visitor interface for a Filter expression.
41 
42  The visitor interface can be implemented by database drivers
43  in order to translate a Filter object to a SQL statement (mostly the where clause).
44 
45  \sa Visitor, FilterCapabilitiesVisitor
46  */
48  {
49  public:
50 
51  /** @name Initializer Methods
52  * Methods related to instantiation and destruction of a Filter visitor.
53  */
54  //@{
55 
56  /*! \brief Default constructor. */
57  Visitor() {}
58 
59  /*! \brief Virtual destructor. */
60  virtual ~Visitor() {}
61 
62  //@}
63 
64  /** @name Visitor Methods
65  * All concrete visitors must implement these methods.
66  */
67  //@{
68 
69  virtual void visit(const AbstractOp& visited) = 0;
70  virtual void visit(const SpatialOp& visited) = 0;
71  virtual void visit(const ComparisonOp& visited) = 0;
72  virtual void visit(const LogicOp& visited) = 0;
73  virtual void visit(const BBOXOp& visited) = 0;
74  virtual void visit(const BinaryComparisonOp& visited) = 0;
75  virtual void visit(const BinaryLogicOp& visited) = 0;
76  virtual void visit(const BinarySpatialOp& visited) = 0;
77  virtual void visit(const DistanceBuffer& visited) = 0;
78  virtual void visit(const PropertyIsBetween& visited) = 0;
79  virtual void visit(const PropertyIsLike& visited) = 0;
80  virtual void visit(const PropertyIsNull& visited) = 0;
81  virtual void visit(const UnaryLogicOp& visited) = 0;
82  virtual void visit(const Expression& visited) = 0;
83  virtual void visit(const BinaryOperator& visited) = 0;
84  virtual void visit(const Function& visited) = 0;
85  virtual void visit(const Literal& visited) = 0;
86  virtual void visit(const PropertyName& visited) = 0;
87 
88  //@}
89 
90  private:
91 
92  /** @name Not Allowed Methods
93  * No copy allowed.
94  */
95  //@{
96 
97  /*!
98  \brief No copy constructor allowed.
99 
100  \param rhs The other object.
101  */
102  Visitor(const Visitor& rhs);
103 
104  /*!
105  \brief No assignment operator allowed.
106 
107  \param rhs The other object.
108 
109  \return A reference for this.
110  */
111  Visitor& operator=(const Visitor& rhs);
112 
113  //@}
114  };
115 
116  } // end namespace fe
117 } // end namespace te
118 
119 #endif // __TERRALIB_FE_INTERNAL_VISITOR_H
Distance buffer operator.
A convenient and more compact way of encoding the very common bounding box constraint based on an env...
Definition: BBOXOp.h:71
A spatial operator determines whether its geometric arguments satisfy the stated spatial relationship...
Definition: SpatialOp.h:49
A class for binary spatial operators.
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
The PropertyIsBetween element is defined as a compact way of encoding a range check.
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:49
Visitor()
Default constructor.
Definition: Visitor.h:57
A logical operator that can be used to combine one conditional expressions.
Definition: UnaryLogicOp.h:46
The PropertyIsNull class encodes an operator that checks to see if the value of its content is NULL...
A function is a named procedure that performs a distinct computation.
Definition: Function.h:54
It is intended to encode a character string comparison operator with pattern matching.
This class can be used to represent binary operation expressions.
virtual ~Visitor()
Virtual destructor.
Definition: Visitor.h:60
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
URI C++ Library.
This is an abstract class that models a Filter Encoding expression.
Definition: Expression.h:50
An abstract interface for operators.
Definition: AbstractOp.h:47
A class for binary comparison operators.
This class can be used to represent literal values.
Definition: Literal.h:56
A logical operator can be used to combine one or more conditional expressions.
Definition: LogicOp.h:52
Configuration flags for the TerraLib Filter Encoding module.
A logical operator can be used to combine two or more conditional expressions.
Definition: BinaryLogicOp.h:58
A visitor interface for a Filter expression.
Definition: Visitor.h:47