PluginInfo.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/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::vector<std::string> m_requiredPlugins; //!< The list of required plugins in order to lunch the plugin.
79  std::vector<std::string> m_requiredPluginCategories; //!< The list of required category of plugins in order to lunch the plugin.
80  std::vector<std::string> m_requiredModules; //!< The list of required category of plugins in order to lunch the plugin.
81  std::vector<Resource> m_resources; //!< The list of resources used by plugin.
82  std::vector<Parameter> m_parameters; //!< Any configuration parameter that can be informed to plugin (map: parameter-name -> parameter-value).
83 
84  /*!
85  \brief This overloaded operator can be used to index the plugin info in a set.
86 
87  \param rhs The right-hand-side plugin info.
88 
89  \return True if this plugin name is lexcographical less than the rhs plugin name.
90  */
91  bool operator<(const PluginInfo& rhs) const
92  {
93  return m_name < rhs.m_name;
94  }
95 
96  struct Finder1st : public std::unary_function<std::pair<std::string, std::string>, bool>
97  {
98  Finder1st(const std::string& val)
99  : m_first(val)
100  {
101  }
102 
103  bool operator()(const std::pair<std::string, std::string>& r)
104  {
105  return r.first == m_first;
106  }
107 
108  std::string m_first;
109  };
110  };
111 
112  } // end namespace plugin
113 } // end namespace te
114 
115 /*!
116  \brief It deserializes the plugin info using the given XML reader.
117 
118  \param pInfo The plugin information struct to be filled.
119  \param xmlReader The XML reader to be used to extract the plugin information.
120 
121  \return A reference to the input pInfo.
122 */
124 
125 #endif // __TERRALIB_PLUGIN_INTERNAL_PLUGININFO_H
126 
bool operator<(const PluginInfo &rhs) const
This overloaded operator can be used to index the plugin info in a set.
Definition: PluginInfo.h:91
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_requiredPlugins
The list of required plugins in order to lunch the plugin.
Definition: PluginInfo.h:78
This class models a XML reader object.
Definition: Reader.h:55
std::vector< std::string > m_requiredModules
The list of required category of plugins in order to lunch the plugin.
Definition: PluginInfo.h:80
This struct can be used to describe a given plugin provider.
Definition: Provider.h:45
std::string m_licenseDescription
A brief description about the plugin license.
Definition: PluginInfo.h:73
std::string m_displayName
The plugin name to be displayed in a graphical interface.
Definition: PluginInfo.h:67
TEPLUGINEXPORT te::plugin::PluginInfo & operator<<(te::plugin::PluginInfo &pInfo, te::xml::Reader &xmlReader)
It deserializes the plugin info using the given XML reader.
Configuration flags for the TerraLib Plugin module.
bool operator()(const std::pair< std::string, std::string > &r)
Definition: PluginInfo.h:103
std::string m_terralibVersion
The TerraLib version this plugin depends on.
Definition: PluginInfo.h:72
std::string m_engine
The type of plugin execution engine: C++, JAVA.
Definition: PluginInfo.h:71
Provider m_provider
Information about the plugin provider.
Definition: PluginInfo.h:77
std::string m_version
The plugin version.
Definition: PluginInfo.h:69
std::string m_site
An URL pointing to the plugin site.
Definition: PluginInfo.h:76
URI C++ Library.
std::vector< std::string > m_requiredPluginCategories
The list of required category of plugins in order to lunch the plugin.
Definition: PluginInfo.h:79
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
This struct can be used to describe a given plugin provider.
std::vector< Resource > m_resources
The list of resources used by plugin.
Definition: PluginInfo.h:81
std::vector< Parameter > m_parameters
Any configuration parameter that can be informed to plugin (map: parameter-name -> parameter-value)...
Definition: PluginInfo.h:82
#define TEPLUGINEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:120
std::pair< std::string, std::string > Resource
Definition: PluginInfo.h:63
Finder1st(const std::string &val)
Definition: PluginInfo.h:98
std::string m_description
A brief explanation about the plugin.
Definition: PluginInfo.h:68
The basic information about a plugin.
Definition: PluginInfo.h:61
std::string m_category
The plugin category.
Definition: PluginInfo.h:75
std::pair< std::string, std::string > Parameter
Definition: PluginInfo.h:64
std::string m_licenseURL
An URL where someone can find more information on the license.
Definition: PluginInfo.h:74