#include <Interpreter.h>

Public Member Functions | |
| virtual std::string | getPrompt () const =0 |
| virtual bool | executeCommand (const std::string &command)=0 |
| virtual bool | executeScopedCommand (const std::string &command, const Slot &output, const Slot &error, Progress *pProgress)=0 |
| virtual bool | isGlobalOutputShown () const =0 |
| virtual void | showGlobalOutput (bool newValue)=0 |
Static Public Member Functions | |
| static const std::string & | signalOutputText () |
| static const std::string & | signalErrorText () |
Protected Member Functions | |
| virtual | ~Interpreter () |
Interpreter implementations implement this interface and this interface is used to execute commands for a given interpreter implementation.
An instance of this class should be retrieved by calling InterpreterManager::getInterpreter() on a InterpreterManager plug-in instance or using InterpreterUtilities::getInterpreter().
Definition at line 32 of file Interpreter.h.
| virtual Interpreter::~Interpreter | ( | ) | [protected, virtual] |
This Interpreter instance is owned by a InterpreterManager instance.
Definition at line 167 of file Interpreter.h.
| static const std::string& Interpreter::signalOutputText | ( | ) | [static] |
Emitted with boost::any<std::string> with output text generated from executing commands provided to executeCommand().
May also be emitted with output text generated from executing commands provided to executeScopedCommand() if isGlobalOutputShown() returns true.
Definition at line 42 of file Interpreter.h.
| static const std::string& Interpreter::signalErrorText | ( | ) | [static] |
Emitted with boost::any<std::string> with error text generated from executing commands provided to executeCommand().
May also be emitted with error text generated from executing commands provided to executeScopedCommand() if isGlobalOutputShown() returns true.
Definition at line 51 of file Interpreter.h.
| virtual std::string Interpreter::getPrompt | ( | ) | const [pure virtual] |
Retrieves the current prompt.
| virtual bool Interpreter::executeCommand | ( | const std::string & | command | ) | [pure virtual] |
Execute the given command.
Regardless of the return value, future calls can be made to this function. This function blocks and will not return until all provided statements have been executed to completion.
Variables created while executing the command persist after command execution in a global scope. This global scope should persist for an Interpreter instance so that later commands can access variables created during execution of earlier commands. Please read executeScopedCommand() which supports different scoping rules.
| command | The command to execute, this command can be a single statement or multi-statements. The syntax for single statements and multi-statements is defined by the given interpreter implementation. |
False if there was a syntatic problem with the given command, the interpreter is not running, or an exception. was thrown from the interpreter. True will be returned otherwise. | virtual bool Interpreter::executeScopedCommand | ( | const std::string & | command, | |
| const Slot & | output, | |||
| const Slot & | error, | |||
| Progress * | pProgress | |||
| ) | [pure virtual] |
Execute the given command.
Regardless of the return value, future calls can be made to this function. This function blocks and will not return until all provided statements have been executed to completion.
Output and error text from executing this command will be be sent to the provided output and error Slot instances. The output and error text is still valid regardless of the return value of this function.
Variables created while executing the provided command can be created in a nested scope that is closed at command completion causing local variables to be freed. A given interpreter implementation can support this nested scope behavior or can share the global and persistent scope used by executeCommand().
true.| command | The command to execute, this command can be a single statement or multi-statements. The syntax for single statements and multi-statements is defined by the given interpreter implementation. | |
| output | This Slot will be called as output text is generated from executing this command. The boost::any provided to the slot will contain a std::string with the output text. | |
| error | This Slot will be called as error text is generated from executing this command. The boost::any provided to the slot will contain a std::string with the error text. | |
| pProgress | If a non-NULL progress is provided, the execution of the provided command may report progress to this instance. A given interpreter implementation is permitted to ignore this parameter. An interpreter will only report progress to this progress instance while executing the provided command. |
False if there was a syntatic problem with the given command, the interpreter is not running, or an exception. was thrown from the interpreter. True will be returned otherwise. | virtual bool Interpreter::isGlobalOutputShown | ( | ) | const [pure virtual] |
Returns the last value provided to showGlobalOutput().
The default value for a given interpreter implementation may be true or false.
| virtual void Interpreter::showGlobalOutput | ( | bool | newValue | ) | [pure virtual] |
Controls whether output from executeScopedCommand() is emitted from SIGNAL_NAME(Interpreter, OutputText) and SIGNAL_NAME(Interpreter, ErrorText).
| newValue | A value of true will cause any ouput or error text generated from calling executeScopedCommand() to also be emitted from SIGNAL_NAME(Interpreter, OutputText) and SIGNAL_NAME(Interpreter, ErrorText). A value of false causes output or error text generated from calling executeScopedCommand() to only be sent to the Slot instances passed to executeScopedCommand(). |