All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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(const std::string& dsType)
41 {
42  //use the factory only to create a data source
43  std::auto_ptr<te::da::DataSource> ds = te::da::DataSourceFactory::make(dsType);
44  if(ds.get()==0)
45  throw Exception(TE_TR("ST Loader: Could not find a data source!"));
46 
47  std::string loaderType = te::st::Globals::sm_loaderFromMemDSIdentifier;
48 
49  //TO DO: olhar o capabilities do Query - spatial and temporal.
50  const te::da::QueryCapabilities& qcpb = ds->getCapabilities().getQueryCapabilities();
51  if(qcpb.supportsSpatialSQLDialect())
53 
55 }
56 
57 te::st::STDataLoaderImplFactory::STDataLoaderImplFactory(const std::string& factoryKey)
58  : te::common::AbstractFactory<STDataLoaderImpl, std::string>(factoryKey)
59 {
60 }
61 
62 te::st::STDataLoaderImplFactory::~STDataLoaderImplFactory()
63 {
64 }
65 
An abstract class responsible for loading spatiotemporal data from data sources.
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:347
static const std::string sm_loaderFromMemDSIdentifier
The st data loader from in-mem data source.
Definition: Globals.h:50
static const std::string sm_loaderFromDSIdentifier
The st data loader from data source.
Definition: Globals.h:49
A class that informs the query support of a given data source.
static std::auto_ptr< DataSource > make(const std::string &dsType)
bool supportsSpatialSQLDialect() const
static TPRODUCT * make(const TFACTORYKEY &factoryKey)
It creates an object with the appropriated factory.
This is the abstract factory for STDataLoaderImpl.