DataSourceInfo.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/dataaccess/datasource/DataSourceInfo.h
22 
23  \brief A conteiner class for keeping information about a data source.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_DATASOURCEINFO_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_DATASOURCEINFO_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // STL
33 #include <map>
34 #include <string>
35 
36 // Boost
37 #include <boost/noncopyable.hpp>
38 #include <boost/shared_ptr.hpp>
39 
40 namespace te
41 {
42  namespace da
43  {
44  /*!
45  \class DataSourceInfo
46 
47  \brief A class that represents a data source component.
48 
49  This class splits the concept of data source from data access drivers.
50 
51  For example, at application level one can have a data source named File that uses
52  diferent drivers to access data. It will depend on user preferences and dialogs used to create
53  the data source.
54 
55  \ingroup dataaccess
56  */
58  {
59  public:
60 
62 
63  ~DataSourceInfo();
64 
65  const std::string& getId() const;
66 
67  void setId(const std::string& id);
68 
69  const std::string& getType() const;
70 
71  void setType(const std::string& dsType);
72 
73  const std::string& getAccessDriver() const;
74 
75  void setAccessDriver(const std::string& d);
76 
77  const std::string& getTitle() const;
78 
79  void setTitle(const std::string& title);
80 
81  const std::string& getDescription() const;
82 
83  void setDescription(const std::string& d);
84 
85  const std::map<std::string, std::string>& getConnInfo() const;
86 
87  std::map<std::string, std::string>& getConnInfo();
88 
89  std::string getConnInfoAsString();
90 
91  void setConnInfo(const std::map<std::string, std::string>& connInfo);
92 
93  void setConnInfoFromString(const std::string& conninfo);
94 
95  bool operator<(const DataSourceInfo& rhs) const;
96 
97  private:
98 
99  std::string m_id;
100  std::string m_dsType;
101  std::string m_accessDriver;
102  std::string m_title;
103  std::string m_description;
104  std::map<std::string, std::string> m_conninfo;
105  };
106 
107  typedef boost::shared_ptr<DataSourceInfo> DataSourceInfoPtr;
108 
109  }// end namespace da
110 } // end namespace te
111 
112 #endif // __TERRALIB_DATAACCESS_INTERNAL_DATASOURCEINFO_H
TEDATAACCESSEXPORT te::da::Expression * operator<(const te::da::Expression &e1, const te::da::Expression &e2)
URI C++ Library.
A class that represents a data source component.
std::map< std::string, std::string > m_conninfo
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr