All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Expression.cpp
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/Expression.cpp
22 
23  \brief This is an abstract class that models a query expression.
24 */
25 
26 // TerraLib
27 #include "And.h"
28 #include "EqualTo.h"
29 #include "Expression.h"
30 #include "GreaterThan.h"
31 #include "GreaterThanOrEqualTo.h"
32 #include "LessThan.h"
33 #include "LessThanOrEqualTo.h"
34 #include "Not.h"
35 #include "NotEqualTo.h"
36 #include "Or.h"
37 
39 {
40  return new te::da::EqualTo(e1.clone(), e2.clone());
41 }
42 
44 {
45  return new te::da::NotEqualTo(e1.clone(), e2.clone());
46 }
47 
49 {
50  return new te::da::And(e1.clone(), e2.clone());
51 }
52 
54 {
55  return new te::da::Or(e1.clone(), e2.clone());
56 }
57 
59 {
60  return new te::da::Not(e.clone());
61 }
62 
64 {
65  return new te::da::GreaterThan(e1.clone(), e2.clone());
66 }
67 
69 {
70  return new te::da::GreaterThanOrEqualTo(e1.clone(), e2.clone());
71 }
72 
74 {
75  return new te::da::LessThan(e1.clone(), e2.clone());
76 }
77 
79 {
80  return new te::da::LessThanOrEqualTo(e1.clone(), e2.clone());
81 }
82 
It models the inequality operator greater than (>).
Definition: GreaterThan.h:46
te::da::Expression * operator||(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:53
It models the inequality operator less than or equal to (<=).
te::da::Expression * operator&&(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:48
te::da::Expression * operator==(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:38
It models the inequality operator greater than (>) - syntatic-suggar.
It models the inequality operator less than (<).
Definition: LessThan.h:46
te::da::Expression * operator>(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:63
It models the inequality operator greater than or equal to (>=).
It models the inequality operator less than or equal to (<=) - syntatic-suggar.
It models the inequality operator greater than or equal to (>=) - syntatic-suggar.
Boolean logic operator: AND.
Definition: And.h:46
This is an abstract class that models a query expression.
Definition: Expression.h:47
te::da::Expression * operator<=(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:78
Boolean NOT operator.
Definition: Not.h:46
te::da::Expression * operator>=(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:68
Definition: Or.h:46
te::da::Expression * operator<(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:73
Tells if two values are not equal.
Definition: NotEqualTo.h:46
Boolean logic operator: OR - syntatic-suggar.
Boolean NOT operator - syntatic-suggar.
te::da::Expression * operator!=(const te::da::Expression &e1, const te::da::Expression &e2)
Definition: Expression.cpp:43
This is an abstract class that models a query expression.
Boolean logic operator: AND - syntatic-suggar.
It models the comparison operator.
Definition: EqualTo.h:46
It models the comparison operator - syntatic-suggar.
It models the inequality operator less than (<) - syntatic-suggar.
te::da::Expression * operator~(const te::da::Expression &e)
Definition: Expression.cpp:58
virtual Expression * clone() const =0
It creates a new copy of this expression.
Tells if two values are not equal - syntatic-suggar.