All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BinaryComparisonOp.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 BinaryComparisonOp.cpp
22 
23  \brief A class for binary comparison operators.
24  */
25 
26 // TerraLib
27 #include "BinaryComparisonOp.h"
28 #include "Expression.h"
29 #include "Globals.h"
30 
31 // STL
32 #include <cassert>
33 
35  : ComparisonOp(opName),
36  m_first(0),
37  m_second(0),
38  m_matchCase(true)
39 {
40 }
41 
43  : ComparisonOp(opName),
44  m_first(f),
45  m_second(s),
46  m_matchCase(true)
47 {
48 }
49 
51 {
52  delete m_first;
53  delete m_second;
54 }
55 
57 {
58  delete m_first;
59  m_first = first;
60 }
61 
63 {
64  return m_first;
65 }
66 
68 {
69  delete m_second;
70  m_second = second;
71 }
72 
74 {
75  return m_second;
76 }
77 
79 {
80  m_matchCase = true;
81 }
82 
84 {
85  m_matchCase = false;
86 }
87 
BinaryComparisonOp(const char *opName=0)
It initializes a new BinaryComparisonOp.
virtual ~BinaryComparisonOp()
Virtual destructor.
void enableMatchCase()
It enables the match case flag. So comparisons will be case sensitive.
void setSecond(Expression *second)
It sets the second operand.
void disableMatchCase()
It disables the match case flag. So comparisons will not be case sensitive.
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:49
void setFirst(Expression *first)
It sets the first operand.
This is an abstract class that models a Filter Encoding expression.
Definition: Expression.h:50
Expression * getSecond() const
It returns the second operand.
This is an abstract class that models a Filter Encoding expression.
An static class with global definitions.
A class for binary comparison operators.
Expression * getFirst() const
It returns the first operand.