ArithmeticOperators.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 terralib/fe/ArithmeticOperators.h
22 
23  \brief It is used to indicate what arithmetic operators the a service can support.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_ARITHMETICOPERATORS_H
27 #define __TERRALIB_FE_INTERNAL_ARITHMETICOPERATORS_H
28 
29 // TerraLib
30 #include "../common/STLUtils.h"
31 #include "Config.h"
32 
33 // STL
34 #include <vector>
35 
36 namespace te
37 {
38  namespace fe
39  {
40 // Forward declarations
41  class FunctionName;
42 
43  /*!
44  \class ArithmeticOperators
45 
46  \brief It is used to indicate the arithmetic operators that a service can support.
47 
48  \sa ScalarCapabilities, FunctionName
49  */
51  {
52  public:
53 
54  /** @name Initializer Methods
55  * Methods related to instantiation and destruction.
56  */
57  //@{
58 
59  /*! \brief It initializes a new ArithmeticOperators. */
61 
62  /*! \brief Destructor. */
64 
65  //@}
66 
67  /** @name Accessor methods
68  * Methods used to get or set properties.
69  */
70  //@{
71 
72  /*! \brief It marks the Simple Arithmetic as supported by the filter. */
73  void enableSimpleArithmetic();
74 
75  /*! \brief It marks the Simple Arithmetic as not supported by the filter. */
76  void disableSimpleArithmetic();
77 
78  /*!
79  \brief It adds the function name to the Arithmetic operator list.
80 
81  \param f The function name to be added to the Arithmetic operator list.
82 
83  \note The ArithmeticOperators object will take the ownership of the function name, so you must not free it.
84  */
85  void push_back(FunctionName* f);
86 
87  /*!
88  \brief It returns a specified function name.
89 
90  \param i The index of desired function name.
91 
92  \return A specified function name.
93 
94  \note You must not clear the returned function name.
95 
96  \note The method will not check the index range.
97  */
98  const FunctionName* operator[](std::size_t i) const;
99 
100  //@}
101 
102  private:
103 
104  bool m_simpleArithmetic; //!< It is used to indicate that the service can support addition, subtraction, multiplication and division. Default: false. (Optional)
105  std::vector<FunctionName*> m_arithmeticOperators; //!< It is used to list the function names that are supported, and the number of arguments each function requires. (Optional)
106  };
107 
108  } // end namespace fe
109 } // end namespace te
110 
111 #endif // __TERRALIB_FE_INTERNAL_ARITHMETICOPERATORS_H
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
std::vector< FunctionName * > m_arithmeticOperators
It is used to list the function names that are supported, and the number of arguments each function r...
bool m_simpleArithmetic
It is used to indicate that the service can support addition, subtraction, multiplication and divisio...
It is used to indicate the arithmetic operators that a service can support.
It is used to list the function names that are supported and the number of arguments each function re...
Definition: FunctionName.h:46
URI C++ Library.
Configuration flags for the TerraLib Filter Encoding module.