Having.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/dataaccess/query/Having.h
22 
23  \brief A Having is a filter expression that can be applied to a query with a group by clause.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_HAVING_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_HAVING_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // STL
33 #include <memory>
34 
35 namespace te
36 {
37  namespace da
38  {
39 // Forward declaration
40  class Expression;
41 
42  /*!
43  \class Having
44 
45  \brief A class that can be used to model a filter expression that can be applied to a query.
46  */
48  {
49  public:
50 
51  /*!
52  \brief Constructor.
53 
54  \param e The where expression.
55 
56  \note The Having clause will take the ownership of the expression.
57  */
58  explicit Having(Expression* e);
59 
60  explicit Having(const Expression& e);
61 
62  Having(const Having& rhs);
63 
64  ~Having();
65 
66  Having& operator=(const Having& rhs);
67 
68  Expression* getExp() const;
69 
70  /*!
71  \brief Sets the expression.
72 
73  \param e The where expression.
74 
75  \note The Having clause will take the ownership of the expression.
76  */
77  void setExp(Expression* exp);
78 
79  private:
80 
81  std::unique_ptr<Expression> m_exp; //!< The expression that defines the where clause.
82  };
83 
84  } // end namespace da
85 } // end namespace te
86 
87 #endif // __TERRALIB_DATAACCESS_INTERNAL_HAVING_H
88 
A class that can be used to model a filter expression that can be applied to a query.
Definition: Having.h:47
This is an abstract class that models a query expression.
Definition: Expression.h:47
URI C++ Library.
std::unique_ptr< Expression > m_exp
The expression that defines the where clause.
Definition: Having.h:81
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97