DataSource.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 terralib/wfs/DataSource.h
22 
23  \brief Implementation of the data source for the WFS driver.
24 */
25 
26 #ifndef __TERRALIB_WFS_INTERNAL_DATASOURCE_H
27 #define __TERRALIB_WFS_INTERNAL_DATASOURCE_H
28 
29 // TerraLib
30 #include "../dataaccess/datasource/DataSource.h"
31 #include "../dataaccess/datasource/DataSourceCapabilities.h"
32 #include "Config.h"
33 #include "Exception.h"
34 #include "WFSLayerInfo.h"
35 
36 // STL
37 #include <string>
38 #include <vector>
39 
40 // Forward declarations
41 //class OGRDataSource;
42 class GDALDataset;
43 
44 namespace te
45 {
46  namespace wfs
47  {
48  /*!
49  \class DataSource
50 
51  \brief Implementation of the data source for the WFS driver.
52  */
54  {
55  public:
56 
57  DataSource(const std::string& connInfo);
58 
60 
62 
63  std::string getType() const;
64 
65  std::unique_ptr<te::da::DataSourceTransactor> getTransactor();
66 
67  void open();
68 
69  void close();
70 
71  bool isOpened() const;
72 
73  bool isValid() const;
74 
76 
78 
80 
81  GDALDataset* getOGRDataSource();
82 
83  const std::vector<WFSLayerInfo>& getLayersInfo();
84 
85  protected:
86 
87  void create(const std::string& connInfo);
88 
89  void drop(const std::string& connInfo);
90 
91  bool exists(const std::string& connInfo);
92 
93  std::vector<std::string> getDataSourceNames(const std::string& connInfo);
94 
95  private:
96 
97  void verifyConnectionInfo() const;
98 
99  /*!
100  * \brief Sets up the enviroment before any atempt to make a request
101  */
102  void setupEnvironment() const;
103 
105 
106  private:
107 
108  GDALDataset* m_ogrDS;
110  std::vector<WFSLayerInfo> m_layersInfo;
112  };
113 
114  } // end namespace wfs
115 } // end namespace te
116 
117 #endif // __TERRALIB_WFS_INTERNAL_DATASOURCE_H
WFSLayerInfo.h
Informations about WFS Layers.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::da::SQLDialect
It represents the SQL query dialect accepted by a given data source.
Definition: SQLDialect.h:56
te::wfs::DataSource::~DataSource
~DataSource()
Virtual destructor.
te::wfs::DataSource::setCapabilities
static void setCapabilities(const te::da::DataSourceCapabilities &capabilities)
te::wfs::DataSource::close
void close()
It closes the data source and clears all the resources used by its internal communication channel.
te::wfs::DataSource::getCapabilities
const te::da::DataSourceCapabilities & getCapabilities() const
It returns the known capabilities of the data source.
te::wfs::DataSource
Implementation of the data source for the WFS driver.
Definition: DataSource.h:54
te::wfs::DataSource::isOpened
bool isOpened() const
It returns true if the data source is opened, otherwise it returns false.
TEWFSEXPORT
#define TEWFSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:104
te::wfs::DataSource::open
void open()
It opens the data source and makes it ready for using.
te::wfs::DataSource::m_layersInfo
std::vector< WFSLayerInfo > m_layersInfo
Definition: DataSource.h:110
te::wfs::DataSource::isValid
bool isValid() const
It checks if the data source is valid (available for using).
te::wfs::DataSource::DataSource
DataSource(const te::core::URI &uri)
te::wfs::DataSource::m_ogrDS
GDALDataset * m_ogrDS
Definition: DataSource.h:108
te::wfs::DataSource::getType
std::string getType() const
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS,...
te::wfs::DataSource::drop
void drop(const std::string &connInfo)
It removes the data source with the connection information from a driver.
capabilities
te::da::DataSourceCapabilities capabilities
Definition: PostGISCapabilities.h:129
te::wfs::DataSource::verifyConnectionInfo
void verifyConnectionInfo() const
te::wfs::DataSource::exists
bool exists(const std::string &connInfo)
Check the existence of a data source in a driver.
Exception.h
An exception class for the XML module.
te::wfs::DataSource::DataSource
DataSource(const std::string &connInfo)
te::core::URI
A class to store the proxy information that must be used to access data located in URIs.
Definition: URI.h:50
te::wfs::DataSource::m_isOpened
bool m_isOpened
Definition: DataSource.h:109
te::wfs::DataSource::setupEnvironment
void setupEnvironment() const
Sets up the enviroment before any atempt to make a request.
te::wfs::DataSource::getDataSourceNames
std::vector< std::string > getDataSourceNames(const std::string &connInfo)
It gets the data source names available in a driver.
te::wfs::DataSource::getOGRDataSource
GDALDataset * getOGRDataSource()
te::wfs::DataSource::getLayersInfo
const std::vector< WFSLayerInfo > & getLayersInfo()
te::da::DataSourceCapabilities
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
Definition: DataSourceCapabilities.h:56
te::wfs::DataSource::getTransactor
std::unique_ptr< te::da::DataSourceTransactor > getTransactor()
It returns the set of parameters used to set up the access channel to the underlying repository.
te::da::DataSource
An abstract class for data providers like a DBMS, Web Services or a regular file.
Definition: DataSource.h:120
te::wfs::DataSource::create
void create(const std::string &connInfo)
It creates a new data source.
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::wfs::DataSource::getDialect
const te::da::SQLDialect * getDialect() const
It returns the data source SQL dialect, if there is one.
te::wfs::DataSource::sm_capabilities
static te::da::DataSourceCapabilities sm_capabilities
Definition: DataSource.h:111
te::wfs::DataSource::buildLayersInfo
void buildLayersInfo()