AbstractPlugin.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/AbstractPlugin.h
22 
23  \brief An abstract class for TerraLib Plugins.
24 */
25 
26 #ifndef __TERRALIB_PLUGIN_INTERNAL_ABSTRACTPLUGIN_H
27 #define __TERRALIB_PLUGIN_INTERNAL_ABSTRACTPLUGIN_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // Boost
33 #include <boost/noncopyable.hpp>
34 
35 namespace te
36 {
37  namespace plugin
38  {
39 // Forward declaration
40  struct PluginInfo;
41 
42  /*!
43  \class AbstractPlugin
44 
45  \brief An abstract class for TerraLib Plugins.
46 
47  A plugin (also called plug-in, addin, add-in, addon,
48  add-on, snap-in, extension or suplement) is a computer program that interacts with a
49  host application like TerraView adding new capabilities/functionalities to it.
50 
51  For more information on plugin definitions, please,
52  see Wikipedia at http://en.wikipedia.org/wiki/Plug-in_%28computing%29.
53 
54  In TerraLib, the easy way to create a plugin for TerraView is to use
55  the Plugin class interface. This is the same interface for C++, PHP, Lua
56  and other languages plugins.
57 
58  Note that in TerraLib any plugin may have access to all other system parts. You can put no restrictions
59  on it, so you can easily use all TerraLib/TerraView API without worry about doing trickies!
60 
61  \ingroup plugin
62 
63  \sa Plugin, PluginManager, PluginInfo, PluginEngine
64  */
65  class TEPLUGINEXPORT AbstractPlugin : public boost::noncopyable
66  {
67  public:
68 
69  /*! \brief Constructor. */
71 
72  /*! \brief Virtual destructor. */
73  virtual ~AbstractPlugin();
74 
75  /*!
76  \brief It return the information associated to the plugin.
77 
78  \return The information associated to the plugin.
79  */
80  virtual const PluginInfo& getInfo() const = 0;
81 
82  /*!
83  \brief It tells if the plugin was started or not.
84 
85  \return True if the plugin is started and false otherwise (it is shutdown).
86  */
87  virtual bool isStarted() const = 0;
88 
89  /*!
90  \brief This method will be called by TerraLib to startup some plugin's functionality.
91 
92  \exception Exception It throws and exception if the plugin can not be started.
93  */
94  virtual void startup() = 0;
95 
96  /*!
97  \brief This method will be called by TerraLib to shutdown plugin's functionality.
98 
99  \exception Exception It throws and exception if the plugin can not be shutdown.
100  */
101  virtual void shutdown() = 0;
102 
103  /*!
104  \brief This overloaded operator can be used to index the plugin in a set.
105 
106  \param rhs The right-hand-side plugin.
107 
108  \return True if this plugin name is lexcographical less than the rhs plugin name.
109  */
110  bool operator<(const AbstractPlugin& rhs) const;
111  };
112 
113  } // end namespace plugin
114 } // end namespace te
115 
116 #endif // __TERRALIB_PLUGIN_INTERNAL_ABSTRACTPLUGIN_H
117 
TEDATAACCESSEXPORT te::da::Expression * operator<(const te::da::Expression &e1, const te::da::Expression &e2)
An abstract class for TerraLib Plugins.
Configuration flags for the TerraLib Plugin module.
URI C++ Library.
#define TEPLUGINEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:120
The basic information about a plugin.
Definition: PluginInfo.h:61