All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Module.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/gdal/Module.h
22 
23  \brief The TerraLib OGR driver is a plugin.
24 */
25 
26 // TerraLib
27 #include "../common/Logger.h"
28 #include "../plugin/PluginInfo.h"
29 #include "../dataaccess/datasource/DataSourceCapabilities.h"
30 #include "../dataaccess/datasource/DataSourceFactory.h"
31 #include "../dataaccess/datasource/DataSourceManager.h"
32 #include "Config.h"
33 #include "DataSourceFactory.h"
34 #include "Module.h"
35 #include "RasterFactory.h"
36 
37 // GDAL
38 #include <gdal_priv.h>
39 
41  : te::plugin::Plugin(pluginInfo)
42 {
43 }
44 
46 {
47 }
48 
50 {
51  if(m_initialized)
52  return;
53 
54 // it initializes the Translator support for the TerraLib GDAL driver support
56 
58 
59  GDALAllRegister();
60 
62 
63  // DataType Capabilites
65  dataTypeCapabilities.setSupportRaster(true);
66 
67  // DataSetType Capabilites
69 
70  // DataSet Capabilities
72  dataSetCapabilities.setSupportEfficientDataSetSize(true);
73 
74  // Query Capabilities
76 
77  // DataSouce Capabilities
79  capabilities.setSupportAll();
80  capabilities.setSupportTransactions(false);
81  capabilities.setDataTypeCapabilities(dataTypeCapabilities);
82  capabilities.setDataSetTypeCapabilities(dataSetTypeCapabilities);
83  capabilities.setDataSetCapabilities(dataSetCapabilities);
84  capabilities.setQueryCapabilities(queryCapabilities);
86 
88 
89  TE_LOG_TRACE(TR_GDAL("TerraLib GDAL driver startup!"));
90 
91  m_initialized = true;
92 }
93 
95 {
96  if(!m_initialized)
97  return;
98 
99 //! it finalizes the GDAL factory support.
101 
103 
104 //! free GDAL registered drivers
106 
107  TE_LOG_TRACE(TR_GDAL("TerraLib GDAL driver shutdown!"));
108 
109  m_initialized = false;
110 }
111 
113 
te::da::DataSetCapabilities dataSetCapabilities
static void initialize()
It initializes the factory: the singleton instance will be registered in the abstract factory DataSou...
Configuration flags for the GDAL Driver of TerraLib.
The basic information about a plugin.
Definition: PluginInfo.h:61
te::da::DataTypeCapabilities dataTypeCapabilities
void startup()
This method will be called by TerraLib to startup some plugin&#39;s functionality.
Definition: Module.cpp:49
A factory for data sources.
void setSupportRaster(const bool &support)
static void setCapabilities(const te::da::DataSourceCapabilities &capabilities)
Definition: DataSource.cpp:155
The TerraLib OGR driver is a plugin.
void setAccessPolicy(const te::common::AccessPolicy &accessPolicy)
void setSupportTransactions(const bool &support)
void setSupportEfficientDataSetSize(const bool &support)
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
A class that informs what kind of constraint and index is supported by a given data source...
void setQueryCapabilities(const QueryCapabilities &capabilities)
#define TE_LOG_TRACE(msg)
Use this tag in order to log a message to a specified logger with the TRACE level.
Definition: Config.h:418
void shutdown()
This method will be called by TerraLib to shutdown plugin&#39;s functionality.
Definition: Module.cpp:94
#define PLUGIN_CALL_BACK_IMPL(PLUGIN_CLASS_NAME)
This macro should be used by C++ plugins in order to declare the exportable/callable DLL function...
Definition: Config.h:57
A class that informs the query support of a given data source.
te::da::QueryCapabilities queryCapabilities
This is the concrete factory for GDAL rasters.
void setDataSetTypeCapabilities(const DataSetTypeCapabilities &capabilities)
#define TE_ADD_TEXT_DOMAIN(domain, domaindir, codeset)
It adds the given text domain located at domain-dir with the given codeset to the multilingual system...
Definition: Config.h:118
The TerraLib GDAL driver is a plugin.
Definition: Module.h:42
static void remove(const std::string &dsType)
#define TE_GDAL_TEXT_DOMAIN
It contains the name of the text domain used in the translation of messages in TerraLib Coverage modu...
Definition: Config.h:50
A class that informs what the dataset implementation of a given data source can perform.
#define TE_GDAL_DRIVER_IDENTIFIER
Definition: Config.h:38
void setDataTypeCapabilities(const DataTypeCapabilities &capabilities)
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
Module(const te::plugin::PluginInfo &pluginInfo)
Plugin constructor.
Definition: Module.cpp:40
A class that represents the supported data types of a specific data source.
te::da::DataSetTypeCapabilities dataSetTypeCapabilities
#define TE_GDAL_TEXT_DOMAIN_DIR
It contains the translation catalog directory.
Definition: Config.h:57
te::da::DataSource * Build()
te::da::DataSourceCapabilities capabilities
static void finalize()
It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the ...
#define TR_GDAL(message)
It marks a string in order to get translated. This is a special mark used in the Vector Geometry modu...
Definition: Config.h:64
static void add(const std::string &dsType, FactoryFnctType f)
void setDataSetCapabilities(const DataSetCapabilities &capabilities)
~Module()
Destructor.
Definition: Module.cpp:45