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 Developer 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
END_OBJECT
OBJECT=SIMPLECYLINDRICAL
LIBRARY=libisis3.so
END_OBJECT
Isis::Projection * SimpleCylindricalPlugin(Isis::Pvl &lab, bool allowDefaults)
This is the function that is called in order to instantiate a SimpleCylindrical object.
Definition SimpleCylindrical.cpp:275
Isis::TProjection * SinusoidalPlugin(Isis::Pvl &lab, bool allowDefaults)
This is the function that is called in order to instantiate a Sinusoidal object.
Definition Sinusoidal.cpp:292

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

Constructor & Destructor Documentation

◆ Plugin()

Isis::Plugin::Plugin ( )

Constructs a Plugin object.

◆ ~Plugin()

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

Destroys the Plugin object.

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.

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: