Executable Class Reference

Provides a common interface for plug-in execution. More...

#include <Executable.h>

Inheritance diagram for Executable:

Inheritance graph

List of all members.

Public Member Functions

virtual bool isExecutedOnStartup () const =0
virtual bool isDestroyedAfterExecute () const =0
virtual const std::vector
< std::string > & 
getMenuLocations () const =0
virtual bool setBatch ()=0
virtual bool setInteractive ()=0
virtual bool getInputSpecification (PlugInArgList *&pArgList)=0
virtual bool getOutputSpecification (PlugInArgList *&pArgList)=0
virtual bool initialize ()=0
virtual bool execute (PlugInArgList *pInArgList, PlugInArgList *pOutArgList)=0
virtual bool abort ()=0
virtual bool hasAbort ()=0
virtual bool isBackground () const =0
virtual bool hasWizardSupport () const =0

Static Public Member Functions

static std::string ProgressArg ()
static std::string ProgressArgDescription ()
static std::string MenuCommandArg ()
static std::string WindowArg ()
static std::string ViewArg ()
static std::string LayerArg ()
static std::string DataElementArg ()

Protected Member Functions

virtual ~Executable ()


Detailed Description

Provides a common interface for plug-in execution.

Defines a generic interface for all plug-ins that is used to query the plug-in for its input/ouput parameters and to execute it in a common way.

Definition at line 25 of file Executable.h.


Constructor & Destructor Documentation

virtual Executable::~Executable (  )  [protected, virtual]

This should be destroyed by calling PlugInManagerServices::destroyPlugIn.

Definition at line 346 of file Executable.h.


Member Function Documentation

static std::string Executable::ProgressArg (  )  [static]

The name for a Progress argument.

Input arguments with this name will be automatically populated with a Progress pointer when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type Progress.

See also:
ExecutableAgent::execute()
Examples:
Tutorial/Tutorial1.cpp, Tutorial/Tutorial2.cpp, Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 37 of file Executable.h.

static std::string Executable::ProgressArgDescription (  )  [static]

The description for a Progress argument.

This description can be used to populate the Description field for a plug-in's input argument list when attaching a Progress argument.

See also:
ExecutableAgent::execute()

Definition at line 47 of file Executable.h.

static std::string Executable::MenuCommandArg (  )  [static]

The name for a menu command argument.

Input arguments with this name will be automatically populated with the menu command name from which the plug-in was executed when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type std::string.

See also:
ExecutableAgent::execute()

Definition at line 59 of file Executable.h.

static std::string Executable::WindowArg (  )  [static]

The name for a Window argument.

Input arguments with this name will be automatically populated with a Window pointer when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type Window or one of its subclasses. It should not be used by an Exporter or subclasses derived from Exporter to access the window associated with the exported item.

See also:
ExecutableAgent::execute()

Definition at line 73 of file Executable.h.

static std::string Executable::ViewArg (  )  [static]

The name for a View argument.

Input arguments with this name will be automatically populated with a View pointer when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type View or one of its subclasses. It should not be used by an Exporter or subclasses derived from Exporter to access the view associated with the exported item.

See also:
ExecutableAgent::execute()

Definition at line 87 of file Executable.h.

static std::string Executable::LayerArg (  )  [static]

The name for a Layer argument.

Input arguments with this name will be automatically populated with a Layer pointer when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type Layer or one of its subclasses. It should not be used by an Exporter or classes derived from Exporter to access the layer associated with the exported item.

See also:
ExecutableAgent::execute()

Definition at line 101 of file Executable.h.

static std::string Executable::DataElementArg (  )  [static]

The name for a DataElement argument.

Input arguments with this name will be automatically populated with a DataElement pointer when the plug-in is executed with an ExecutableAgent. Arguments with this name should be of the type DataElement or one of its subclasses. It should not be used by Exporter or classes derived from Exporter to access a DataElement associated with the exported item.

See also:
ExecutableAgent::execute()
Examples:
Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 115 of file Executable.h.

virtual bool Executable::isExecutedOnStartup (  )  const [pure virtual]

Queries whether the plug-in is automatically executed when the application starts.

Returns:
Returns true if the plug-in is automatically executed when the application is created; otherwise returns false.

Implemented in ExecutableShell.

virtual bool Executable::isDestroyedAfterExecute (  )  const [pure virtual]

Queries whether the plug-in is automatically destroyed after it is successfully executed.

Plug-ins which are not successfully executed are automatically destroyed by the application.

After a plug-in is successfully executed, it can be destroyed by the application or stay resident in memory. A plug-in may need to exist after execution, such as those containing modeless GUI components that require user interaction or continually display data.

Returns:
Returns true if the plug-in is automatically destroyed after it is successfully executed; otherwise returns false.
See also:
execute()

Implemented in ExecutableShell.

virtual const std::vector<std::string>& Executable::getMenuLocations (  )  const [pure virtual]

Returns the menu locations and names of the commands from which the plug-in is executed.

Returns:
A vector of strings representing the menu locations and names of the commands that are used to execute the plug-in.

Each string is formatted with brackets ([,]) to specify a toolbar and a slash (/) to indicate submenus. The toolbar name appears first in the string, followed by an optional slash, and then the menus, submenus and command name separated by slashes. If the optional slash appears following the toolbar name, this indicates that the submenus and command should be added to the default toolbar menu, which has the same name as the toolbar. If a slash does not follow the toolbar name, the menus and command are added directly to the toolbar. If the string does not include a toolbar name, the menus and command are added to the main menu bar. The string cannot end with a slash, and the name after the last slash indicates the command name.

Examples of the menu string include the following:
  • [Geo]/Georeference
  • &Tools/Flicker Window

An empty vector is returned if the plug-in should not be executed from the menus.

Implemented in ExecutableShell.

virtual bool Executable::setBatch (  )  [pure virtual]

Sets the plug-in to execute in batch mode.

This method is used to set the plug-in to execute in a non-GUI mode.

Returns:
Returns true if batch mode is supported and the plug-in was successfully set to execute in a non-GUI mode. Returns false if the plug-in does not support batch mode, or if batch mode cannot currently be set on the plug-in.
See also:
setInteractive()

Implemented in DockWindowShell, ExecutableShell, and AlgorithmPlugIn.

virtual bool Executable::setInteractive (  )  [pure virtual]

Sets the plug-in to execute in interactive mode.

This method is used to set the plug-in to execute in a GUI mode.

Returns:
Returns true if interactive mode is supported and the plug-in was successfully set to execute in a GUI mode. Returns false if the plug-in does not support interactive mode, or if interactive mode cannot currently be set on the plug-in.
See also:
setBatch()

Implemented in ExecutableShell, and AlgorithmPlugIn.

virtual bool Executable::getInputSpecification ( PlugInArgList *&  pArgList  )  [pure virtual]

Retrieves the plug-in input parameters.

This method queries the plug-in for its input parameters that are needed to execute properly. The input arguments may be different in interactive mode and batch mode.

Parameters:
pArgList A plug-in arg list pointer that is set to a created input argument list specifying the plug-in input parameters. NULL is a valid pointer value if the plug-in does not require any input arguments.
Returns:
Returns true if the input parameter argument list was successfully created. If the plug-in does not require input arguments, true is returned, but the given plug-in arg list pointer may be NULL.
See also:
PlugInArgList

Implemented in DockWindowShell, ExporterShell, GeoreferenceShell, InterpreterManagerShell, RasterElementImporterShell, ViewerShell, AlgorithmPlugIn, CachedPager, and HdfPager.

Examples:
Tutorial/Tutorial1.h, Tutorial/Tutorial2.h, Tutorial/Tutorial3.h, Tutorial/Tutorial4.h, and Tutorial/Tutorial5.h.

virtual bool Executable::getOutputSpecification ( PlugInArgList *&  pArgList  )  [pure virtual]

Retrieves the plug-in output parameters.

This method queries the plug-in for its output parameters that are created during execution. The output arguments may be different in interactive mode and batch mode.

Parameters:
pArgList A plug-in arg list pointer that is set to a created output argument list specifying the plug-in output parameters. NULL is a valid pointer value if the plug-in does not provide any output arguments.
Returns:
Returns true if the output parameter argument list was successfully created. If the plug-in does not provide output arguments, true is returned, but the given plug-in arg list pointer may be NULL.
See also:
PlugInArgList

Implemented in DockWindowShell, ExporterShell, GeoreferenceShell, InterpreterManagerShell, RasterElementImporterShell, RasterPagerShell, ViewerShell, WizardShell, AlgorithmPlugIn, and CachedPager.

Examples:
Tutorial/Tutorial1.h, Tutorial/Tutorial2.h, Tutorial/Tutorial3.h, Tutorial/Tutorial4.h, and Tutorial/Tutorial5.h.

virtual bool Executable::initialize (  )  [pure virtual]

Initializes the plug-in before execution.

This method is used by the plug-in manager to initialize the plug-in before it is executed.

Returns:
Returns true if the plug-in initialization was sucessful; otherwise returns false.

Implemented in ExecutableShell.

virtual bool Executable::execute ( PlugInArgList pInArgList,
PlugInArgList pOutArgList 
) [pure virtual]

Executes the plug-in.

Parameters:
pInArgList On input, pInArgList contains a complete input argument list for the plug-in. The actual values are used as inputs when executing the plug-in. Default values may be used if an actual value is not present.
pOutArgList On input, pOutArgList contains a complete output argument list for the plug-in, although actual values and default values will be ignored. On return, the actual values in the argument list will be updated to include all output parameters defined by the plug-in.
Returns:
Returns true if the execution was successful. Returns false if an error occurred or if the user cancelled the plug-in while in interactive mode.
See also:
getInputSpecification(), getOutputSpecification()

Implemented in DockWindowShell, RasterElementImporterShell, AlgorithmPlugIn, and CachedPager.

Examples:
Tutorial/Tutorial1.h, Tutorial/Tutorial2.h, Tutorial/Tutorial3.h, Tutorial/Tutorial4.h, and Tutorial/Tutorial5.h.

virtual bool Executable::abort (  )  [pure virtual]

Aborts the plug-in during execution.

This method may be called by the application to attempt to gracefully abort a plug-in. Depending on the specific plug-in implementation of this method, it may simply initiate the abort process and return or it may attempt to complete the abort process before returning.

Returns:
Returns true if the plug-in was successfully aborted or transformed to an aborted state, which does not necessarily mean that the plug-in has completed aborting. Returns false if the plug-in could not abort successfully or if the plug-in does not support aborting.
See also:
hasAbort()

Implemented in ExecutableShell, ViewerShell, and AlgorithmPlugIn.

virtual bool Executable::hasAbort (  )  [pure virtual]

Queries whether the plug-in can be aborted.

This method may be called to determine if the plug-in can be aborted. This can be useful in GUI applications where the user may not be given the chance to cancel.

Returns:
Returns true if the plug-in supports the ability to abort, otherwise returns false. Plug-ins that do not have significant processing or loops can also return false.

Implemented in ExecutableShell.

virtual bool Executable::isBackground (  )  const [pure virtual]

Queries whether the plug-in performs background processing.

This method is called by the application after executing the plug-in to determine if the plug-in should be unloaded or should wait until processing is finished. This method is called before isDestroyedAfterExecute() is called, so a return value of false does not necessarily mean that the plug-in will be destroyed.

Returns:
Returns true if the plug-in performs background processing. Destruction and possible unloading of the plug-in will be delayed until the plug-in indicates that background processing has ended. Returns false if the plug-in does not support background processing or is not performing background processing during this instance.
See also:
DesktopServices::registerCallback()

Implemented in ExecutableShell.

virtual bool Executable::hasWizardSupport (  )  const [pure virtual]

Queries whether the plug-in supports being added as a wizard item.

This method is called by the application to determine if the user should be able to add this plug-in as a wizard item in the wizard builder.

Returns:
Returns true if the user should be able to add this plug-in to the wizard builder. Returns false if the user should NOT be able to add this plug-in to the wizard builder.

Implemented in ExecutableShell.


Software Development Kit - Opticks 4.9.0 Build 16218