All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CppPluginProxy.cpp
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.cpp
22 
23  \brief An abstract interface for Plugins written in C++.
24 */
25 
26 // TerraLib
27 #include "CppPluginProxy.h"
28 #include "Plugin.h"
29 
31  : m_lib(lib),
32  m_plugin(plugin)
33 {
34 }
35 
37 {
38 // if we need to assure that plugin goes out of scope
39 // before the library, we will need to remove the following comment
40 // m_plugin.release();
41 }
42 
44 {
45  return m_plugin->getInfo();
46 }
47 
49 {
50  return m_plugin->isStarted();
51 }
52 
54 {
55  m_plugin->startup();
56 }
57 
59 {
60  m_plugin->shutdown();
61 }
62 
63 
A base class for plugin types.
boost::shared_ptr< Library > LibraryPtr
Definition: Library.h:184
CppPluginProxy(const te::common::LibraryPtr &lib, Plugin *plugin)
Construct a proxy for the real C++ plugin.
void startup()
Forward the startup to the real plugin .
A base class for plugin types.
Definition: Plugin.h:50
void shutdown()
Forward the shutdown to the real plugin.
const PluginInfo & getInfo() const
Forward the info retrieval to the real plugin.
A proxy class for C++ plugins.
The basic information about a plugin.
Definition: PluginInfo.h:61
bool isStarted() const
Forward the info retrieval to the real plugin.