All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PluginInfo.h
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/plugin/PluginInfo.h
22 
23  \brief The basic information about a plugin.
24 */
25 
26 #ifndef __TERRALIB_PLUGIN_INTERNAL_PLUGININFO_H
27 #define __TERRALIB_PLUGIN_INTERNAL_PLUGININFO_H
28 
29 // TerraLib
30 #include "Config.h"
31 #include "Provider.h"
32 
33 // STL
34 #include <map>
35 #include <string>
36 #include <vector>
37 
38 namespace te
39 {
40 // Forward declaration
41  namespace xml { class Reader; }
42 
43  namespace plugin
44  {
45  /*!
46  \struct PluginInfo
47 
48  \brief The basic information about a plugin.
49 
50  \ingroup plugin
51 
52  \sa Plugin
53 
54  \note There are some special plugins categories:
55  <ul>
56  <li>Data Access</li>
57  <li>Unknown Category</li>
58  <li>Language Bindings</li>
59  </ul>
60  */
61  struct PluginInfo
62  {
63  typedef std::pair<std::string, std::string> Resource;
64  typedef std::pair<std::string, std::string> Parameter;
65 
66  std::string m_name; //!< The plugin name: an internal value used to identify the plugin in the system. Must be a unique value.
67  std::string m_displayName; //!< The plugin name to be displayed in a graphical interface.
68  std::string m_description; //!< A brief explanation about the plugin.
69  std::string m_version; //!< The plugin version.
70  std::string m_release; //!< The release date of the plugin. This may be used to identify new versions of a given plugin.
71  std::string m_engine; //!< The type of plugin execution engine: C++, JAVA.
72  std::string m_terralibVersion; //!< The TerraLib version this plugin depends on.
73  std::string m_licenseDescription; //!< A brief description about the plugin license.
74  std::string m_licenseURL; //!< An URL where someone can find more information on the license.
75  std::string m_category; //!< The plugin category.
76  std::string m_site; //!< An URL pointing to the plugin site.
77  Provider m_provider; //!< Information about the plugin provider.
78  std::string m_folder; //!< The plugin folder (where the plugin is installed).
79  std::vector<std::string> m_requiredPlugins; //!< The list of required plugins in order to lunch the plugin.
80  std::vector<std::string> m_requiredPluginCategories; //!< The list of required category of plugins in order to lunch the plugin.
81  std::vector<std::string> m_requiredModules; //!< The list of required category of plugins in order to lunch the plugin.
82  std::vector<Resource> m_resources; //!< The list of resources used by plugin.
83  std::vector<Parameter> m_parameters; //!< Any configuration parameter that can be informed to plugin (map: parameter-name -> parameter-value).
84 
85  /*!
86  \brief This overloaded operator can be used to index the plugin info in a set.
87 
88  \param rhs The right-hand-side plugin info.
89 
90  \return True if this plugin name is lexcographical less than the rhs plugin name.
91  */
92  bool operator<(const PluginInfo& rhs) const
93  {
94  return m_name < rhs.m_name;
95  }
96 
97  struct Finder1st : public std::unary_function<std::pair<std::string, std::string>, bool>
98  {
99  Finder1st(const std::string& val)
100  : m_first(val)
101  {
102  }
103 
104  bool operator()(const std::pair<std::string, std::string>& r)
105  {
106  return r.first == m_first;
107  }
108 
109  std::string m_first;
110  };
111  };
112 
113  } // end namespace plugin
114 } // end namespace te
115 
116 /*!
117  \brief It deserializes the plugin info using the given XML reader.
118 
119  \param pInfo The plugin information struct to be filled.
120  \param xmlReader The XML reader to be used to extract the plugin information.
121 
122  \return A reference to the input pInfo.
123 */
125 
126 #endif // __TERRALIB_PLUGIN_INTERNAL_PLUGININFO_H
127 
std::ostream & operator<<(const te::common::Exception &e, std::ostream &o)
It serializes the exception and sends it to the output stream.
Definition: Exception.cpp:68
std::pair< std::string, std::string > Resource
Definition: PluginInfo.h:63
The basic information about a plugin.
Definition: PluginInfo.h:61
#define TEPLUGINEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:151
std::vector< Resource > m_resources
The list of resources used by plugin.
Definition: PluginInfo.h:82
std::vector< std::string > m_requiredPlugins
The list of required plugins in order to lunch the plugin.
Definition: PluginInfo.h:79
This struct can be used to describe a given plugin provider.
std::vector< Parameter > m_parameters
Any configuration parameter that can be informed to plugin (map: parameter-name -&gt; parameter-value)...
Definition: PluginInfo.h:83
bool operator<(const PluginInfo &rhs) const
This overloaded operator can be used to index the plugin info in a set.
Definition: PluginInfo.h:92
This class models a XML reader object.
Definition: Reader.h:55
Configuration flags for the TerraLib Plugin module.
This struct can be used to describe a given plugin provider.
Definition: Provider.h:45
std::vector< std::string > m_requiredPluginCategories
The list of required category of plugins in order to lunch the plugin.
Definition: PluginInfo.h:80
std::pair< std::string, std::string > Parameter
Definition: PluginInfo.h:64
std::string m_licenseDescription
A brief description about the plugin license.
Definition: PluginInfo.h:73
std::string m_licenseURL
An URL where someone can find more information on the license.
Definition: PluginInfo.h:74
std::string m_description
A brief explanation about the plugin.
Definition: PluginInfo.h:68
std::string m_site
An URL pointing to the plugin site.
Definition: PluginInfo.h:76
std::string m_version
The plugin version.
Definition: PluginInfo.h:69
std::string m_terralibVersion
The TerraLib version this plugin depends on.
Definition: PluginInfo.h:72
Finder1st(const std::string &val)
Definition: PluginInfo.h:99
Provider m_provider
Information about the plugin provider.
Definition: PluginInfo.h:77
bool operator()(const std::pair< std::string, std::string > &r)
Definition: PluginInfo.h:104
std::string m_engine
The type of plugin execution engine: C++, JAVA.
Definition: PluginInfo.h:71
std::string m_release
The release date of the plugin. This may be used to identify new versions of a given plugin...
Definition: PluginInfo.h:70
std::string m_name
The plugin name: an internal value used to identify the plugin in the system. Must be a unique value...
Definition: PluginInfo.h:66
std::vector< std::string > m_requiredModules
The list of required category of plugins in order to lunch the plugin.
Definition: PluginInfo.h:81
std::string m_folder
The plugin folder (where the plugin is installed).
Definition: PluginInfo.h:78
std::string m_category
The plugin category.
Definition: PluginInfo.h:75
std::string m_displayName
The plugin name to be displayed in a graphical interface.
Definition: PluginInfo.h:67