InterpreterManager Class Reference

All interpreters must implement this interface which defines how the application and plug-ins execute commands with an interpreter implementation. More...

#include <InterpreterManager.h>

Inheritance diagram for InterpreterManager:

Inheritance graph

List of all members.

Public Member Functions

virtual bool isStarted () const =0
virtual bool start ()=0
virtual std::string getStartupMessage () const =0
virtual bool isInteractiveEnabled () const =0
virtual InterpretergetInterpreter () const =0
virtual std::string getFileExtensions () const =0

Static Public Member Functions

static const std::string & signalInterpreterStarted ()

Protected Member Functions

virtual ~InterpreterManager ()


Detailed Description

All interpreters must implement this interface which defines how the application and plug-ins execute commands with an interpreter implementation.

Interpreter implementations must also implement the PlugIn interface. It is recommended a interpreter implementation subclass from InterpreterManagerShell.

An interpreter implementation must also provide an implementation of the Interpreter interface.

See also:
Interpreter

Definition at line 35 of file InterpreterManager.h.


Constructor & Destructor Documentation

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

This should be destroyed by calling PlugInManagerServices::destroyPlugIn.

Definition at line 165 of file InterpreterManager.h.


Member Function Documentation

static const std::string& InterpreterManager::signalInterpreterStarted (  )  [static]

Emitted when the interpreter starts.

If a given interpreter implementation executes during application start-up, this signal may never be emitted. It only suggested you attach to this signal if calling isStarted() returns false. This signal is permitted to be emitted even if no calls to start() have been made (i.e. the user entered required configuration information into a dialog while the application was running).

Definition at line 51 of file InterpreterManager.h.

virtual bool InterpreterManager::isStarted (  )  const [pure virtual]

Returns if the interpreter is started and running.

If this returns true, getInterpreter() must return non-NULL. If this returns false, getInterpreter() must return NULL.

Returns:
True if the interpreter is started and running, false otherwise.
See also:
getStartupMessage()

virtual bool InterpreterManager::start (  )  [pure virtual]

Attempt to start the interpreter.

This method can be called multiple times without any ill effect. This method can be called even if the interpreter is already started and no changes will be made to the already running interpreter. If this method returns true, subsequent calls to isStarted() must return true

If this result of calling this method will change the return value of isStarted() from false to true, then SIGNAL_NAME(InterpreterManager, InterpreterStarted) must be emitted.

Returns:
True if the interpreter was started or was already running. Returns false if the interpreter was not already running and could not be started.
See also:
getStartupMessage()

virtual std::string InterpreterManager::getStartupMessage (  )  const [pure virtual]

Returns the startup message from the last failed start or the message from a successful start.

Returns:
The startup message from the last failed start or the message from a successful start.
See also:
start(), isStarted()

virtual bool InterpreterManager::isInteractiveEnabled (  )  const [pure virtual]

Returns whether the user should be permitted to enter commands into the Scripting Window.

If true is returned, the user will be permitted to enter commands into the Scripting Window. If false, the Scripting Window will be made read-only. The value returned from this function must not change between calls to this function.

The behavior of Interpreter::executeCommand() and Interpreter::executeScopedCommand() must NOT be different based upon the return value of this function.

Returns:
Returns whether the user should be permitted to enter commands into the Scripting Window.

Implemented in InterpreterManagerShell.

virtual Interpreter* InterpreterManager::getInterpreter (  )  const [pure virtual]

Returns the Interpreter instance that can be used to execute commands.

The lifetime of the returned instance is guaranteed to be at least as long as the lifetime of the InterpreterManager instance this method was called on. However, after the InterpreterManager instance has been deleted, the returned Interpreter instance should be considered invalid.

Returns:
The Interpreter instance that can be used to execute commands. This must return NULL if a call to isStarted() false and must return non-NULL if a call to isStarted() returns true.

virtual std::string InterpreterManager::getFileExtensions (  )  const [pure virtual]

Returns the default scripting file extensions recognized by the interpreter.

Returns:
The file extensions recognized by the interpreter as a string. The string consists of a description followed by one or more file extensions separated by a space. Multiple file types may be specified with a double semicolon. Examples include "ENVI Header Files (*.hdr)", "TIFF Files (*.tif *.tiff)", and "Source Files (*.c*);;Header Files (*.h)".

Implemented in InterpreterManagerShell.


Software Development Kit - Opticks 4.9.0 Build 16218