All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FromFunctionCall.cpp
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/FromFunctionCall.cpp
22 
23  \brief A function can be used as a source of information in another query.
24 */
25 
26 // TerraLib
27 #include "FromFunctionCall.h"
28 #include "Function.h"
29 
31  : FromItem(alias),
32  m_f(f)
33 {
34 }
35 
36 te::da::FromFunctionCall::FromFunctionCall(const Function& f, const std::string& alias)
37  : FromItem(alias),
38  m_f(0)
39 {
40  m_f.reset(static_cast<Function*>(f.clone()));
41 }
42 
44  : FromItem(rhs),
45  m_f(0)
46 {
47  m_f.reset(rhs.m_f.get() ? static_cast<Function*>(rhs.m_f->clone()) : 0);
48 }
49 
51 {
52 }
53 
55 {
56  if(this != &rhs)
57  {
59 
60  m_f.reset(rhs.m_f.get() ? static_cast<Function*>(rhs.m_f->clone()) : 0);
61  }
62 
63  return *this;
64 }
65 
67 {
68  return new FromFunctionCall(*this);
69 }
70 
72 {
73  return m_f.get();
74 }
75 
77 {
78  m_f.reset(f);
79 }
80 
FromFunctionCall & operator=(const FromFunctionCall &rhs)
Function * getFunction() const
It returns the associated function.
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
A class that models a Function expression.
std::auto_ptr< Function > m_f
The associated function.
TE_DEFINE_VISITABLE FromFunctionCall(Function *f, const std::string &alias)
Constructor.
void setFunction(Function *f)
It sets the function associated to this object.
Expression * clone() const
It creates a new copy of this expression.
Definition: Function.cpp:57
FromItem & operator=(const FromItem &rhs)
Definition: FromItem.cpp:34
FromItem * clone() const
It creates a new copy of this FromItem.
A class that models a Function expression.
Definition: Function.h:47
A function can be used as a source of information in another query.
A Select can be used as a source of information in another query.