Loading...
Searching...
No Matches
JoinConditionUsing.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/JoinConditionUsing.h
22
23 \brief JoinConditionUsing class can be used to model a USING clause in a Join.
24*/
25
26#ifndef __TERRALIB_DATAACCESS_INTERNAL_JOINCONDITIONUSING_H
27#define __TERRALIB_DATAACCESS_INTERNAL_JOINCONDITIONUSING_H
28
29// TerraLib
30#include "JoinCondition.h"
31
32// Boost
33#include <boost/ptr_container/ptr_vector.hpp>
34
35namespace te
36{
37 namespace da
38 {
39 /*!
40 \class JoinConditionUsing
41
42 \brief JoinConditionUsing class can be used to model a USING clause in a Join.
43
44 \sa JoinCondition, JoinConditionOn
45 */
47 {
48 public:
49
51
52 /*! \brief Default constructor. */
54
55 /*! \brief Copy constructor. */
57
58 /*! \brief Destructor. */
60
61 /*! Assignment operator. */
63
64 /*! \brief It creates a new copy of this JoinCondition. */
66
67 /*!
68 \brief It returns the number of fields in this join condition.
69
70 \return The number of fields in this join condition.
71 */
72 std::size_t getNumFields() const { return m_fields.size(); }
73
74 /*!
75 \brief It adds the condition to the conteiner.
76
77 \param e The condition to be added to the join.
78 */
80
81 /*!
82 \brief It returns the i-th condition.
83
84 \param i The condition position.
85
86 \return The i-th condition.
87 */
88 const Expression* operator[](std::size_t i) const;
89
90 /*!
91 \brief It releases the i-th condition expression and trim the conteiner.
92
93 \param i The condition to be removed.
94 */
95 void erase(std::size_t i);
96
97 /*! \brief It will release all condition expressions and then it will clear the conteiner. */
98 void clear();
99
100 private:
101
102 boost::ptr_vector<Expression> m_fields; //!< The join column list.
103 };
104
105 } // end namespace da
106} // end namespace te
107
108#endif // __TERRALIB_DATAACCESS_INTERNAL_JOINCONDITIONUSING_H
109
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A condition to be used in a Join clause.
This is an abstract class that models a query expression.
Definition: Expression.h:48
JoinConditionUsing class can be used to model a USING clause in a Join.
void clear()
It will release all condition expressions and then it will clear the conteiner.
void erase(std::size_t i)
It releases the i-th condition expression and trim the conteiner.
TE_DEFINE_VISITABLE JoinConditionUsing()
Default constructor.
JoinConditionUsing & operator=(const JoinConditionUsing &rhs)
const Expression * operator[](std::size_t i) const
It returns the i-th condition.
~JoinConditionUsing()
Destructor.
std::size_t getNumFields() const
It returns the number of fields in this join condition.
void push_back(Expression *e)
It adds the condition to the conteiner.
JoinConditionUsing(const JoinConditionUsing &rhs)
Copy constructor.
JoinCondition * clone() const
It creates a new copy of this JoinCondition.
boost::ptr_vector< Expression > m_fields
The join column list.
A condition to be used in a Join clause.
Definition: JoinCondition.h:45
TerraLib.
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97