ComparisonOperators.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 ComparisonOperators.h
22 
23  \brief It is used to indicate what types of comparison operators are supported by a service.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_COMPARISONOPERATORS_H
27 #define __TERRALIB_FE_INTERNAL_COMPARISONOPERATORS_H
28 
29 // TerraLib
30 #include "../common/Comparators.h"
31 #include "Config.h"
32 
33 // STL
34 #include <set>
35 #include <vector>
36 
37 namespace te
38 {
39  namespace fe
40  {
41  /*!
42  \class ComparisonOperators
43 
44  \brief It is used to indicate what types of comparison operators are supported by a service.
45 
46  The operators name can be:
47  <ul>
48  <li>PropertyIsLessThan</li>
49  <li>PropertyIsGreaterThan</li>
50  <li>PropertyIsLessThanEqualTo</li>
51  <li>PropertyIsGreaterThanEqualTo</li>
52  <li>EqualTo</li>
53  <li>PropertyIsNotEqualTo</li>
54  <li>Like</li>
55  <li>Between</li>
56  <li>NullCheck</li>
57  </ul>
58 
59  \sa ScalarCapabilities
60 
61  \todo Fazer um metodo estatico que verifica se um dado operador de comparaco encontra-se no set... e ja retirna o const char* dele ou NULL senao encontrar...
62  */
64  {
65  public:
66 
67  /** @name Initializer Methods
68  * Methods related to instantiation and destruction.
69  */
70  //@{
71 
72  /*! \brief It initializes a new ComparisonOperators. */
74 
75  /*! \brief Destructor. */
77 
78  //@}
79 
80  /** @name Accessor methods
81  * Methods used to get or set properties.
82  */
83  //@{
84 
85  /*!
86  \brief It adds the comparison operator to the supported list of operators.
87 
88  \param c The comparison operator to be added to the supported list of operators.
89  */
90  void push_back(const char* c);
91 
92  /*!
93  \brief It returns a specified comparison operator.
94 
95  \param i The index of desired comparison operator.
96 
97  \return A specified comparison operator.
98 
99  \note You must not clear the returned comparison operator.
100 
101  \note The method will not check the index range.
102  */
103  const char* operator[](size_t i) const;
104 
105  /*!
106  \brief It checks if operator 'o' is a valid operator. It returns a pointer
107  to the found operator or NULL otherwise.
108 
109  \param o The operator name we are looking for.
110  */
111  static const char* findOperator(const char* o);
112 
113  /*! \brief It loads the valid comparison operator list. */
114  static void loadValidOperatorList();
115 
116  /*! \brief It clears the valid comparison operator list. */
117  static void clearValidOperatorList();
118 
119  //@}
120 
121  private:
122 
123  std::vector<const char*> m_comparisonOperators; //!< Optional.
124  static std::set<const char*, te::common::LessCmp<const char*> > sm_validComparisonOperators; //!< The list of valid comparison operators.
125  };
126 
127  } // end namespace fe
128 } // end namespace te
129 
130 #endif // __TERRALIB_FE_INTERNAL_COMPARISONOPERATORS_H
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
static std::set< const char *, te::common::LessCmp< const char * > > sm_validComparisonOperators
The list of valid comparison operators.
URI C++ Library.
Configuration flags for the TerraLib Filter Encoding module.
std::vector< const char * > m_comparisonOperators
Optional.
It is used to indicate what types of comparison operators are supported by a service.