SubSelect.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/SubSelect.h
22 
23  \brief A Select can be used as a source of information in another query.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_SUBSELECT_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_SUBSELECT_H
28 
29 // TerraLib
30 #include "FromItem.h"
31 
32 // STL
33 #include <memory>
34 
35 namespace te
36 {
37  namespace da
38  {
39 // Forward declarations
40  class Select;
41 
42  /*!
43  \class SubSelect
44 
45  \brief A Select can be used as a source of information in another query.
46 
47  \sa FromItem, DataSetName, DataSetType, DataSet, FromFunctionCall, Join
48  */
50  {
51  public:
52 
54 
55  /*!
56  \brief Constructor.
57 
58  \param s The real SubSelect to be associated to this object.
59 
60  \note The SubSelect will take the ownership of the Select.
61  */
62  SubSelect(Select* s, const std::string& alias);
63 
64  /*!
65  \brief Constructor.
66 
67  \param s The real SubSelect to be associated to this object.
68  */
69  SubSelect(const Select& s, const std::string& alias);
70 
71  /*! \brief Copy constructor. */
72  SubSelect(const SubSelect& rhs);
73 
74  /*! \brief Destructor. */
75  ~SubSelect();
76 
77  /*! Assignment operator. */
78  SubSelect& operator=(const SubSelect& rhs);
79 
80  /*! \brief It creates a new copy of this FromItem. */
81  FromItem* clone() const;
82 
83  /*!
84  \brief It returns the associated subselect.
85 
86  \return The associated subselect.
87  */
88  Select* getSelect() const;
89 
90  /*!
91  \brief It sets the real SubSelect associated to this object.
92 
93  \param s The SubSelect to be associated to the FromItem object.
94 
95  \note The SubSelect will take the ownership of the Select.
96  */
97  void setSelect(Select* s);
98 
99  private:
100 
101  std::auto_ptr<Select> m_select; //!< The associated SubSelect.
102  };
103 
104  } // end namespace da
105 } // end namespace te
106 
107 #endif // __TERRALIB_DATAACCESS_INTERNAL_SUBSELECT_H
108 
std::auto_ptr< Select > m_select
The associated SubSelect.
Definition: SubSelect.h:101
An abstract class that models a source of data in a query.
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
URI C++ Library.
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
A Select can be used as a source of information in another query.
Definition: SubSelect.h:49