All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CppPluginProxy.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/CppPluginProxy.h
22 
23  \brief A proxy class for C++ plugins.
24 */
25 
26 #ifndef __TERRALIB_PLUGIN_INTERNAL_CPPPLUGINPROXY_H
27 #define __TERRALIB_PLUGIN_INTERNAL_CPPPLUGINPROXY_H
28 
29 // TerraLib
30 #include "../common/Library.h"
31 #include "AbstractPlugin.h"
32 
33 // STL
34 #include <memory>
35 
36 namespace te
37 {
38  namespace plugin
39  {
40 // Forward declaration
41  class Plugin;
42 
43  /*!
44  \class CppPluginProxy
45 
46  \brief A proxy class for C++ plugins.
47 
48  \ingroup plugin
49 
50  \sa AbstractPlugin, Plugin, CppPlugin
51  */
53  {
54  public:
55 
56  /*!
57  \brief Construct a proxy for the real C++ plugin.
58 
59  \param lib A pointer to the library that contains the plugin.
60  \param plugin The real C++ plugin. The CppPluginProxy will take the ownership of the given plugin.
61  */
62  CppPluginProxy(const te::common::LibraryPtr& lib, Plugin* plugin);
63 
64  /*! \brief Destructor. */
65  ~CppPluginProxy();
66 
67  /*! \brief Forward the info retrieval to the real plugin. */
68  const PluginInfo& getInfo() const;
69 
70  /*! \brief Forward the info retrieval to the real plugin. */
71  bool isStarted() const;
72 
73  /*! \brief Forward the startup to the real plugin . */
74  void startup();
75 
76  /*! \brief Forward the shutdown to the real plugin. */
77  void shutdown();
78 
79  private:
80 
81  te::common::LibraryPtr m_lib; //!< The library that contains the real plugin.
82  std::auto_ptr<Plugin> m_plugin; //!< The real C++ plugin.
83  };
84 
85  } // end namespace plugin
86 } // end namespace te
87 
88 #endif // __TERRALIB_PLUGIN_INTERNAL_CPPPLUGINPROXY_H
89 
boost::shared_ptr< Library > LibraryPtr
Definition: Library.h:184
An abstract class for TerraLib Plugins.
A proxy class for C++ plugins.
An abstract class for TerraLib Plugins.
A base class for plugin types.
Definition: Plugin.h:50
std::auto_ptr< Plugin > m_plugin
The real C++ plugin.
te::common::LibraryPtr m_lib
The library that contains the real plugin.
#define TEPLUGINEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:123
The basic information about a plugin.
Definition: PluginInfo.h:61