Loading...
Searching...
No Matches
Insert.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/Insert.h
22
23 \brief A Insert can be used to add information in a table.
24*/
25
26#ifndef __TERRALIB_DATAACCESS_INTERNAL_INSERT_H
27#define __TERRALIB_DATAACCESS_INTERNAL_INSERT_H
28
29// TerraLib
30#include "DataSetName.h"
31#include "Field.h"
32#include "Fields.h"
33#include "Select.h"
34#include "Query.h"
35
36// STL
37#include <memory>
38
39namespace te
40{
41 namespace da
42 {
43 /*!
44 \class Insert
45
46 \brief The Insert object can add the return of a select object.
47
48 \sa Select, Field, Fields, DataSet, DataSetName
49 */
51 {
52 public:
53
55
56 /*!
57 \brief Constructor.
58
59 \param d The name of the dataset to insert data.
60 \param f Vector with the fields to set data by select.
61 \param s The real SubSelect to be associated to this object.
62
63 \note The Insert will take the ownership of the Select.
64 */
66
67 /*!
68 \brief Constructor.
69
70 \param d The name of the dataset to insert data.
71 \param f Vector with the fields to set data by select.
72 \param s The real SubSelect to be associated to this object.
73 */
74 Insert(const DataSetName& d, const Fields& f, const Select& s);
75
76 /*!
77 \brief Constructor.
78
79 \param d The name of the dataset to insert data.
80 \param s The real SubSelect to be associated to this object.
81
82 \note The Insert will take the ownership of the Select.
83 */
85
86 /*!
87 \brief Constructor.
88
89 \param d The name of the dataset to insert data.
90 \param s The real SubSelect to be associated to this object.
91 */
92 Insert(const DataSetName& d, const Select& s);
93
94 /*! \brief Copy constructor. */
95 Insert(const Insert& rhs);
96
97 /*! \brief Destructor. */
99
100 /*! Assignment operator. */
101 Insert& operator=(const Insert& rhs);
102
103 /*! \brief It creates a new copy of this Insert. */
104 Query* clone() const;
105
106 /*!
107 \brief It returns the associated DataSetName.
108
109 \return The associated DataSetName.
110 */
112
113 /*!
114 \brief It sets the DataSetName associated to this object.
115
116 \param d The Table to be associated to the Insert object.
117
118 \note The Insert will take the ownership of the FromItem.
119 */
121
122 /*!
123 \brief It returns the associated fields.
124
125 \return The associated fields.
126 */
128
129 /*!
130 \brief It sets the Fields associated to this object.
131
132 \param f Fields to be associated to the Insert object.
133
134 \note The Insert will take the ownership of the Fields.
135 */
137
138 /*!
139 \brief It returns the associated select.
140
141 \return The associated select.
142 */
144
145 /*!
146 \brief It sets the select associated to this object.
147
148 \param s The Select to be associated to the Insert object.
149
150 \note The Insert will take the ownership of the Select.
151 */
153
154 private:
155
156 std::unique_ptr<DataSetName> m_dsName; //!< The associated DataSetName.
157 std::unique_ptr<Fields> m_fields; //!< The associated Fields.
158 std::unique_ptr<Select> m_select; //!< The associated Select.
159 };
160
161 } // end namespace da
162} // end namespace te
163
164#endif // __TERRALIB_DATAACCESS_INTERNAL_INSERT_H
165
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A class that models the name of a dataset used in a From clause.
The Field class can be used to model an expression that takes part of the output items of a SELECT.
The Fields class can be used to model a set of expressions that form the output items of a SELECT.
The base class for queries.
A Select models a query to be used when retrieving data from a data source.
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:44
The Insert object can add the return of a select object.
Definition: Insert.h:51
void setFields(Fields *f)
It sets the Fields associated to this object.
void setSelect(Select *s)
It sets the select associated to this object.
std::unique_ptr< Fields > m_fields
The associated Fields.
Definition: Insert.h:157
std::unique_ptr< DataSetName > m_dsName
The associated DataSetName.
Definition: Insert.h:156
std::unique_ptr< Select > m_select
The associated Select.
Definition: Insert.h:158
Insert(const DataSetName &d, const Fields &f, const Select &s)
Constructor.
Insert & operator=(const Insert &rhs)
void setDataSetName(DataSetName *d)
It sets the DataSetName associated to this object.
Insert(DataSetName *d, Select *s)
Constructor.
Fields * getFields() const
It returns the associated fields.
DataSetName * getDataSetName() const
It returns the associated DataSetName.
Insert(const DataSetName &d, const Select &s)
Constructor.
Select * getSelect() const
It returns the associated select.
~Insert()
Destructor.
TE_DEFINE_VISITABLE Insert(DataSetName *d, Fields *f, Select *s)
Constructor.
Insert(const Insert &rhs)
Copy constructor.
Query * clone() const
It creates a new copy of this Insert.
A Query is independent from the data source language/dialect.
Definition: Query.h:47
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:67
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:40
TerraLib.
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97