STDataLoaderImplFactory.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 STDataLoaderImplFactory.cpp
22 
23  \brief This is the abstract factory for STDataLoaderImpl.
24 */
25 
26 // TerraLib
27 #include "../../dataaccess/datasource/DataSource.h"
28 #include "../../dataaccess/datasource/DataSourceFactory.h"
29 #include "../../dataaccess/datasource/DataSourceCapabilities.h"
30 #include "../../dataaccess/query/QueryCapabilities.h"
31 
32 // ST
33 #include "../Exception.h"
34 #include "../Globals.h"
36 
37 // STL
38 #include <memory>
39 
40 te::st::STDataLoaderImpl* te::st::STDataLoaderImplFactory::make(
41  const std::string& /*dsType*/)
42 {
44 }
45 
46 te::st::STDataLoaderImpl* te::st::STDataLoaderImplFactory::make(const std::string& dsType, const std::string& connInfo)
47 {
48  //use the factory only to create a data source
49  std::unique_ptr<te::da::DataSource> ds = te::da::DataSourceFactory::make(dsType, connInfo);
50  if (ds.get() == nullptr)
51  throw Exception(TE_TR("ST Loader: Could not find a data source!"));
52 
53  std::string loaderType = te::st::Globals::sm_loaderFromMemDSIdentifier;
54 
55  //TO DO: olhar o capabilities do Query - spatial and temporal.
56  const te::da::QueryCapabilities& qcpb = ds->getCapabilities().getQueryCapabilities();
57  if (qcpb.supportsSpatialSQLDialect())
59 
61 }
62 
63 te::st::STDataLoaderImplFactory::STDataLoaderImplFactory(const std::string& factoryKey)
64  : te::common::AbstractFactory<STDataLoaderImpl, std::string>(factoryKey)
65 {
66 }
67 
68 te::st::STDataLoaderImplFactory::~STDataLoaderImplFactory() = default;
An abstract class responsible for loading spatiotemporal data from data sources.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
static te::dt::Date ds(2010, 01, 01)
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:242
static const std::string sm_loaderFromMemDSIdentifier
The st data loader from in-mem data source.
static const std::string sm_loaderFromDSIdentifier
The st data loader from data source.
A class that informs the query support of a given data source.
URI C++ Library.
Definition: Attributes.h:37
bool supportsSpatialSQLDialect() const
static TPRODUCT * make(const TFACTORYKEY &factoryKey)
It creates an object with the appropriated factory.
This is the abstract factory for STDataLoaderImpl.