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/wcs/DataSource.h
22 
23  \brief Implementation of the data source for the WCS driver.
24 */
25 
26 #ifndef __TERRALIB_WCS_INTERNAL_DATASOURCE_H
27 #define __TERRALIB_WCS_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 
35 // STL
36 #include <map>
37 #include <string>
38 
39 namespace te
40 {
41  namespace wcs
42  {
43  /*!
44  \class DataSource
45 
46  \brief Implementation of the data source for the WCS driver.
47  */
49  {
50  public:
51 
52  DataSource();
53 
54  ~DataSource();
55 
56  std::string getType() const;
57 
58  const std::map<std::string, std::string>& getConnectionInfo() const;
59 
60  void setConnectionInfo(const std::map<std::string, std::string>& connInfo);
61 
62  std::auto_ptr<te::da::DataSourceTransactor> getTransactor();
63 
64  void open();
65 
66  void close();
67 
68  bool isOpened() const;
69 
70  bool isValid() const;
71 
72  const te::da::DataSourceCapabilities& getCapabilities() const;
73 
74  static void setCapabilities(const te::da::DataSourceCapabilities& capabilities);
75 
76  const te::da::SQLDialect* getDialect() const;
77 
78  protected:
79 
80  void create(const std::map<std::string, std::string>& dsInfo);
81 
82  void drop(const std::map<std::string, std::string>& dsInfo);
83 
84  bool exists(const std::map<std::string, std::string>& dsInfo);
85 
86  std::vector<std::string> getDataSourceNames(const std::map<std::string, std::string>& dsInfo);
87 
88  std::vector<te::common::CharEncoding> getEncodings(const std::map<std::string, std::string>& dsInfo);
89 
90  private:
91 
92  void verifyConnectionInfo() const;
93 
94  private:
95 
96  std::map<std::string, std::string> m_connectionInfo;
97  bool m_isOpened;
99  };
100 
101  } // end namespace wcs
102 } // end namespace te
103 
104 #endif // __TERRALIB_WCS_INTERNAL_DATASOURCE_H
#define TEWCSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:69
An exception class for the TerraLib WCS 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. ...
Definition: DataSource.h:118
te::da::DataSourceCapabilities capabilities
URI C++ Library.
Configuration flags for the TerraLib WCS module.
Implementation of the data source for the WCS driver.
Definition: DataSource.h:48
static te::da::DataSourceCapabilities sm_capabilities
Definition: DataSource.h:98
std::map< std::string, std::string > m_connectionInfo
Definition: DataSource.h:96