Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
Isis::Plugin Class Reference

Loads plugins from a shared library. More...

#include <Plugin.h>

Inheritance diagram for Isis::Plugin:
Inheritance graph
Collaboration diagram for Isis::Plugin:
Collaboration graph

Public Member Functions

 Plugin ()
 Constructs a Plugin object.
 
virtual ~Plugin ()
 Destroys the Plugin object.
 
QFunctionPointer GetPlugin (const QString &group)
 This method returns a void pointer to a C function (i.e., the plugin) It does this by looking in itself (Pvl) for the keyword LIBRARY and the keyword ROUTINE.
 

Detailed Description

Loads plugins from a shared library.

This class is used to handle dynamic loading of module/classes. It is rarely used directly but instead is inherited for a particular purpose such as managing class specific map projections or camera models. The class is derived from a PVL which aides in the selection of the shared library and plugin routine to load. For example, assume the file my.plugin contained:

OBJECT=SINUSOIDAL
LIBRARY=libisis3.so
ROUTINE=SinusoidalPlugin
END_OBJECT
OBJECT=SIMPLECYLINDRICAL
LIBRARY=libisis3.so
ROUTINE=SimpleCylindricalPlugin
END_OBJECT

The desired routine can be selected in code as follows:

p.Read("my.plugin");
string proj;
cin >> proj; // Enter either SINUSOIDAL or SIMPLECYLINDRICAL
p.Find(proj);
void *ptr = p.GetPlugin();
QFunctionPointer GetPlugin(const QString &group)
This method returns a void pointer to a C function (i.e., the plugin) It does this by looking in itse...
Definition Plugin.cpp:39
Plugin()
Constructs a Plugin object.
Definition Plugin.cpp:22

Obtaining plugins can be difficult to understand. It is suggested you look at ProjectionFactory to get a better understanding of how they are used.

See also
ProjectionFactory
CameraFactory
Author
2004-02-07 Jeff Anderson
History

2005-02-15 Jeff Anderson refactored to use Qt Qlibrary class.

2007-07-19 Steven Lambright Fixed memory leak

Definition at line 55 of file Plugin.h.

Constructor & Destructor Documentation

◆ Plugin()

Isis::Plugin::Plugin ( )

Constructs a Plugin object.

Definition at line 22 of file Plugin.cpp.

◆ ~Plugin()

virtual Isis::Plugin::~Plugin ( )
inlinevirtual

Destroys the Plugin object.

Definition at line 60 of file Plugin.h.

Member Function Documentation

◆ GetPlugin()

QFunctionPointer Isis::Plugin::GetPlugin ( const QString & group)

This method returns a void pointer to a C function (i.e., the plugin) It does this by looking in itself (Pvl) for the keyword LIBRARY and the keyword ROUTINE.

When you write this function make sure to place extern "C" infront of it to eliminate C++ symbol mangling.

Parameters
groupThe group name.
Returns
A void pointer to a C function (i.e., the plugin)
History
2010-03-16 Tracie Sucharski, Added paths to plugin. First try to load from current working directory, then from $ISISROOT/lib.

Definition at line 39 of file Plugin.cpp.

Referenced by Isis::AtmosModelFactory::Create(), Isis::AutoRegFactory::Create(), Isis::InterestOperatorFactory::Create(), Isis::NormModelFactory::Create(), Isis::NormModelFactory::Create(), Isis::PhotoModelFactory::Create(), and Isis::PolygonSeederFactory::Create().


The documentation for this class was generated from the following files: