xc
OpComparacion.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //OpComparacion.h
22 
23 #ifndef OPCOMPARACION_H
24 #define OPCOMPARACION_H
25 
26 #include "OpBinario.h"
27 #include "operator_names.h"
28 
30 class OpComparacion: public OpBinario
31  {
32  public:
33  OpComparacion(void) : OpBinario() {}
34  inline virtual int GetPrioridad(void) const
35  { return 3; }
36  };
37 
41 class OpMenor : public OpComparacion
42  {
43 
44  public:
45  OpMenor(void) : OpComparacion() {}
46  inline virtual const std::string &getName(void) const
47  { return nmbOpMenor; }
48  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
49  };
50 
55  {
56 
57  public:
58  OpLessOrEqual(void) : OpComparacion() {}
59  inline virtual const std::string &getName(void) const
60  { return nmbOpLessOrEqual; }
61  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
62  };
63 
67 class OpEqual : public OpComparacion
68  {
69 
70  public:
71  OpEqual(void) : OpComparacion() {}
72  inline virtual const std::string &getName(void) const
73  { return nmbOpEqual; }
74  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
75  };
76 
80 class OpMayor : public OpComparacion
81  {
82 
83  public:
84  OpMayor(void) : OpComparacion() {}
85  inline virtual const std::string &getName(void) const
86  { return nmbOpMayor; }
87  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
88  };
89 
94  {
95 
96  public:
97  OpGreaterOrEqual(void) : OpComparacion() {}
98  inline virtual const std::string &getName(void) const
99  { return nmbOpGreaterOrEqual; }
100  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
101  };
102 
106 class OpDistinto : public OpComparacion
107  {
108 
109  public:
110  OpDistinto(void) : OpComparacion() {}
111  inline virtual const std::string &getName(void) const
112  { return nmbOpDistinto; }
113  virtual const Operando &Opera(const Operando *v1= NULL,const Operando *v2= NULL) const;
114  };
115 
116 #endif
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:72
Equal operator Return 1 if the left value is equal to the right one, 0 otherwise. ...
Definition: OpComparacion.h:67
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:59
Operador distinto.
Definition: OpComparacion.h:106
Operando.
Definition: Operando.h:42
Operador mayor que.
Definition: OpComparacion.h:80
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:111
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:85
Operador menor que.
Definition: OpComparacion.h:41
Clase base para operadores de comparación.
Definition: OpComparacion.h:30
Operador less or equal than.
Definition: OpComparacion.h:54
Operador binario.
Definition: OpBinario.h:32
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:46
virtual const std::string & getName(void) const
Return the operand name.
Definition: OpComparacion.h:98
Operador greater thar or equal to.
Definition: OpComparacion.h:93