attic/src/wms/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/wms/DataSource.h
22 
23  \brief Implementation of the data source for the WMS driver.
24 */
25 
26 #ifndef __TERRALIB_WMS_INTERNAL_DATASOURCE_H
27 #define __TERRALIB_WMS_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 "WMSLayerInfo.h"
35 
36 // STL
37 #include <map>
38 #include <string>
39 
40 namespace te
41 {
42  namespace wms
43  {
44  /*!
45  \class DataSource
46 
47  \brief Implementation of the data source for the WMS driver.
48  */
50  {
51  public:
52 
53  DataSource(const std::string& connInfo);
54 
55  DataSource(const te::core::URI& uri);
56 
57  ~DataSource();
58 
59  std::string getType() const;
60 
61  std::auto_ptr<te::da::DataSourceTransactor> getTransactor();
62 
63  void open();
64 
65  void close();
66 
67  bool isOpened() const;
68 
69  bool isValid() const;
70 
71  const te::da::DataSourceCapabilities& getCapabilities() const;
72 
73  static void setCapabilities(const te::da::DataSourceCapabilities& capabilities);
74 
75  const te::da::SQLDialect* getDialect() const;
76 
77  const std::map<std::string, WMSLayerInfo>& getLayersInfo() const;
78 
79  protected:
80 
81  void create(const std::string& connInfo);
82 
83  void drop(const std::string& connInfo);
84 
85  bool exists(const std::string& connInfo);
86 
87  std::vector<std::string> getDataSourceNames(const std::string& connInfo);
88 
89  private:
90 
91  void verifyConnectionInfo() const;
92 
93  private:
94 
95  bool m_isOpened;
96  std::map<std::string, WMSLayerInfo> m_layersInfo;
98  };
99 
100  } // end namespace wms
101 } // end namespace te
102 
103 #endif // __TERRALIB_WMS_INTERNAL_DATASOURCE_H
Implementation of the data source for the WMS driver.
#define TEWMSEXPORT
You can use this macro in order to export/import classes and functions from this module.
It represents the SQL query dialect accepted by a given data source.
Definition: SQLDialect.h:55
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
std::map< std::string, WMSLayerInfo > m_layersInfo
te::da::DataSourceCapabilities capabilities
URI C++ Library.
Definition: Attributes.h:37
void DataSource()
A class for representing an Uniform Resource Identifier (URI).
Definition: URI.h:49
static te::da::DataSourceCapabilities sm_capabilities