Merge.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 Difference.h
22 
23  \brief Difference operation.
24 
25  \ingroup vp
26  */
27 
28 #ifndef __TERRALIB_VP_INTERNAL_MERGE_H
29 #define __TERRALIB_VP_INTERNAL_MERGE_H
30 
31 //Terralib
32 
33 #include "../dataaccess/dataset/DataSet.h"
34 #include "../dataaccess/dataset/DataSetType.h"
35 #include "../dataaccess/datasource/DataSource.h"
36 
37 #include "../datatype/Property.h"
38 
39 #include "../geometry/Enums.h"
40 #include "../memory/DataSet.h"
41 
42 #include "Algorithm.h"
43 #include "AlgorithmParams.h"
44 #include "Config.h"
45 
46 // STL
47 #include <map>
48 #include <memory>
49 #include <string>
50 #include <vector>
51 
52 namespace te
53 {
54  namespace da { class DataSourceTransactor; }
55 
56  namespace dt { class Property; }
57 
58  namespace vp
59  {
60  class TEVPEXPORT Merge : public Algorithm
61  {
62  public:
63 
65  {
66  PUREMERGE = 0,
67  TRYGETMAX = 1,
68  AUTOINCREMENT = 2
69  };
70 
71  Merge();
72 
73  virtual ~Merge() {}
74 
76 
78 
79  protected:
80 
82 
83  std::vector<std::pair<std::string, std::string> > getPropNames(const std::map<std::string, te::dt::AbstractData*>& specificParams);
84 
85  std::unique_ptr<te::da::DataSetType> getOutputDataSetType(te::vp::AlgorithmParams* mainParams);
86 
87  bool isUpdate(const std::map<std::string, te::dt::AbstractData*>& specificParams);
88 
89  int tryGetMax();
90 
91  bool isPrimaryKeyProperty(const te::da::DataSetType* dst, const std::string& p);
92 
94 
96 
97  private:
98 
105 
107  std::string m_outDsetName;
108 
110 
112 
113  std::vector<std::pair<std::string, std::string> > m_properties;
114 
115  };
116  }
117 }
118 #endif // __TERRALIB_VP_INTERNAL_MERGE_H
te::vp::Merge::m_properties
std::vector< std::pair< std::string, std::string > > m_properties
Definition: Merge.h:113
te::vp::Merge::executeMemory
bool executeMemory(te::vp::AlgorithmParams *mainParams)
te::vp::Merge::Merge
Merge()
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::Merge::checkStrategy
MergeStrategy checkStrategy()
te::vp::Merge::m_originDs
te::da::DataSet * m_originDs
Definition: Merge.h:104
te::vp::Merge::m_targetSRID
int m_targetSRID
Definition: Merge.h:111
AlgorithmParams.h
Algorithm Parameters.
te::vp::AlgorithmParams
Definition: AlgorithmParams.h:52
te::vp::Merge::m_targetDs
te::da::DataSet * m_targetDs
Definition: Merge.h:101
te::vp::Merge::MergeStrategy
MergeStrategy
Definition: Merge.h:65
te::vp::Algorithm
Define input/output parameters for an operation.
Definition: Algorithm.h:45
te::vp::Merge::m_outDsrc
te::da::DataSourcePtr m_outDsrc
Definition: Merge.h:106
te::vp::Merge::m_originDst
te::da::DataSetType * m_originDst
Definition: Merge.h:103
te::vp::Merge::~Merge
virtual ~Merge()
Definition: Merge.h:73
te::da::DataSourceTransactor
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
Definition: DataSourceTransactor.h:89
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
te::vp::Merge::updateInputDst
void updateInputDst(te::da::DataSourceTransactor *transactor)
te::vp::Merge
Definition: Merge.h:61
te::vp::Merge::m_outDsetName
std::string m_outDsetName
Definition: Merge.h:107
te::vp::Merge::getOutputDataSetType
std::unique_ptr< te::da::DataSetType > getOutputDataSetType(te::vp::AlgorithmParams *mainParams)
te::vp::Merge::m_isUpdate
bool m_isUpdate
Definition: Merge.h:109
te::vp::Merge::getPropertyType
int getPropertyType(const te::dt::Property *p)
te::vp::Merge::getPropNames
std::vector< std::pair< std::string, std::string > > getPropNames(const std::map< std::string, te::dt::AbstractData * > &specificParams)
te::vp::Merge::tryGetMax
int tryGetMax()
te::vp::Merge::executeQuery
bool executeQuery(te::vp::AlgorithmParams *mainParams)
Algorithm.h
Abstract algorithm.
te::vp::Merge::m_targetDst
te::da::DataSetType * m_targetDst
Definition: Merge.h:100
te::dt::Property
It models a property definition.
Definition: Property.h:60
te::da::DataSourcePtr
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
te::da::DataSet
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:114
te::vp::Merge::isUpdate
bool isUpdate(const std::map< std::string, te::dt::AbstractData * > &specificParams)
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::vp::Merge::isPrimaryKeyProperty
bool isPrimaryKeyProperty(const te::da::DataSetType *dst, const std::string &p)
te::da::DataSetType
A class that models the description of a dataset.
Definition: DataSetType.h:73
te::vp::Merge::m_originSource
te::da::DataSourcePtr m_originSource
Definition: Merge.h:102
te::vp::Merge::m_targetSource
te::da::DataSourcePtr m_targetSource
Definition: Merge.h:99