IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for main application classes that have the main method of the application based on command line interpreter. More...
Public Member Functions | |
ApplicationCommandlineBase () | |
Constructor. More... | |
virtual void | AddDefaultAssemblies () |
Adds assemblies to be automatically referenced by loaded scripts. More... | |
abstract void | TestMain (string[] args) |
Runs tests from scripts according to hard-coded settings. More... | |
virtual void | AplicationMain (string[] args) |
Default main method for the current application. More... | |
Public Attributes | |
string | OptDir |
Optimization directory that contains data and message files of optimization server. More... | |
Protected Member Functions | |
virtual void | SetUserName (string userName) |
Sets name of the current user. This method is provided to enable testing code under another user name. Setting to null anihilates effect of previous calls. More... | |
abstract CommandLineApplicationInterpreter | CreateInterpreter () |
Creates and returns application's command-line interpreter. More... | |
int | GetScriptNumArguments () |
Returns the number of script run method's arguments (i.e. arguments that are stored in DirectArguments and InterpreterArguments). If there are different numbers of More... | |
virtual void | SetScriptNumArguments (int numArguments) |
Sets the number of script run method's arguments to the specified number. Reallocates argument arrays if necessary. More... | |
virtual void | SetScriptArgument (int whichArgument, string argumentValue) |
Sets the specified script argument; updates array of arguments for running script directly as well as arguments for running script through interpreter. More... | |
virtual string | GetScriptArgument (int whichArgument) |
Gets the specified string arguments, as it is currently set. More... | |
Protected Attributes | |
const string | ConstScriptTests = "ScriptTests" |
Selecting constant fot TEST script. More... | |
const string | ConstScriptCustomApp = "ScriptCustomApp" |
Selecting constant fot CUSTOM script. More... | |
const string | ConstInteractive = "Interactive" |
Selecting constant for interactive run. More... | |
string | ConstRunInteractive = "Interactive" |
Interpreter command for running in interactive mode. More... | |
string | ConstRunScript = "RunScript" |
Interpreter command for running dynamic scripts. More... | |
string | ScriptLocation = null |
Location of the script to be loaded. More... | |
string | ScriptGroupChoice |
Main selector for script that is run. More... | |
string | _scriptChoice |
Type | _scriptType |
string | ScriptAction |
Selector for script action. More... | |
string[] | DirectArguments = null |
Script arguments used when script is run directly by creating a script object. More... | |
string[] | InterpreterArguments = null |
Interpreter arguments used when script is run through interpreter. More... | |
string | DefaultActiveDir |
Default active directory. The current directory will be set to this directory. More... | |
ILoadableScript | _scriptToRun |
bool | RunThroughInterpreter = false |
Whether script is loaded and run through interpreter (alternative is direct construction of script class). More... | |
string | _userNameLowerCase = null |
CommandLineApplicationInterpreter | TestInterpreter |
Application interpreter for running test scripts. More... | |
Properties | |
string | ScriptChoice [get, set] |
Name of the selected script type that is run. More... | |
Type | ScriptType [get, set] |
Selected type of the script to be run. More... | |
ILoadableScript | ScriptToRun [get, set] |
Script to be run. More... | |
virtual string | UserNameLowerCase [get] |
Gets name of the current user with all letters converted to lower case (in order to avoid ambiguities). More... | |
virtual bool | IsUserIgor [get] |
Returns true if the current user logged on the computer is Igor, or false otherwise. More... | |
virtual bool | IsUserTadej [get] |
Returns true if the current user logged on the computer is Tadej, or false otherwise. More... | |
Base class for main application classes that have the main method of the application based on command line interpreter.
Dhis class represent the base for standard scheme for IGLib-based applications that include command-line interpreter and eventually a number of tests whose selection is hard-coded and which are performed when application command-line arguments are not specified.
$A Igor xx Nov09;
|
inline |
Constructor.
|
inlineprotectedvirtual |
Sets name of the current user. This method is provided to enable testing code under another user name. Setting to null anihilates effect of previous calls.
After call to this method, user name can be set to null in order to retrieve the true user logged in for subsequent operations.
Warning: you should use this only exceptionally, e.g. for testing, and only in testing or demo sections of code.
userName | Name of the user to be set. Null annihilates previous calls and causes that system provided user name is returned by subsequent queries. |
References IG.Lib.UtilSystem.SetUsername().
|
protectedpure virtual |
Creates and returns application's command-line interpreter.
Implemented in IG.Script.LoadableScriptShellNeuralBase.StoredScriptSettings, IG.Lib.LoadableScriptBase.StoredScriptSettings, IG.Lib.ShellApplication< InterpreterType >, IG.Script.LoadableScriptShellNeural.StoredScriptSettings, and IG.Lib.LoadableScriptShellBase.StoredScriptSettings.
|
inlinevirtual |
Adds assemblies to be automatically referenced by loaded scripts.
Reimplemented in IG.Lib.ShellApplication< InterpreterType >.
References IG.Lib.ScriptLoaderBase.AddDefaultAssemblies().
|
inlineprotected |
Returns the number of script run method's arguments (i.e. arguments that are stored in DirectArguments and InterpreterArguments). If there are different numbers of
|
inlineprotectedvirtual |
Sets the number of script run method's arguments to the specified number. Reallocates argument arrays if necessary.
Number of arguments includes script run command and command selector for script's internal interpreter, i.e. this number is 2 greater than the number of pure arguments.
For arguments for running script through interpreter, actual number of arguments is 2 greater because it includes command for script loading/running + script location.
numArguments |
|
inlineprotectedvirtual |
Sets the specified script argument; updates array of arguments for running script directly as well as arguments for running script through interpreter.
whichArgument | Index of argument in the array of arguments that is actually passed to the script (in the case of running through interpreter, this means without interpreter command for running dynamic scripts and without script location). The 0-th argument is typically (but not always) reserved for action selection. |
argumentValue | Value of the specified argument to be set. |
$A Igor Nov09 Dec11;
|
inlineprotectedvirtual |
Gets the specified string arguments, as it is currently set.
whichArgument | Index of the obtained argument in the array of arguments to be passed to the script (in the case of running through interpreter, this means without interpreter command for running dynamic scripts and without script location). The 0-th argument is typically (but not always) reserved for action selection. |
|
pure virtual |
Runs tests from scripts according to hard-coded settings.
Standard form of test applications for functionality based on IGLib.
args | Command-line argumets passed when the application is run. |
Standard scheme for IGLib-based test applications has been adopted in December 2011.
$A Igor xx Nov09 Dec11;
Implemented in IG.Script.LoadableScriptShellNeuralBase.StoredScriptSettings, IG.Lib.LoadableScriptBase.StoredScriptSettings, IG.Lib.ShellApplication< InterpreterType >, IG.Script.LoadableScriptShellNeural.StoredScriptSettings, and IG.Lib.LoadableScriptShellBase.StoredScriptSettings.
|
inlinevirtual |
Default main method for the current application.
args | Command-line argumets passed when the application is run. |
Standard scheme for IGLib-based test applications has been adopted in December 2011.
$A Igor xx Nov09 Dec11;
Reimplemented in IG.Lib.ShellApplication< InterpreterType >.
References IG.Lib.CommandLineApplicationInterpreter.MainThread, IG.Lib.CommandLineApplicationInterpreter.Run(), and IG.Lib.CommandLineApplicationInterpreter.WarnCommandReplacement.
|
protected |
Selecting constant fot TEST script.
Test scripts typically include several example methods, which can be selected by the first command-line argument.
|
protected |
Selecting constant fot CUSTOM script.
|
protected |
Selecting constant for interactive run.
|
protected |
Interpreter command for running in interactive mode.
|
protected |
Interpreter command for running dynamic scripts.
|
protected |
Location of the script to be loaded.
|
protected |
Main selector for script that is run.
|
protected |
|
protected |
|
protected |
Selector for script action.
|
protected |
Script arguments used when script is run directly by creating a script object.
|
protected |
Interpreter arguments used when script is run through interpreter.
|
protected |
Default active directory. The current directory will be set to this directory.
string IG.Lib.ApplicationCommandlineBase.OptDir |
Optimization directory that contains data and message files of optimization server.
|
protected |
|
protected |
Whether script is loaded and run through interpreter (alternative is direct construction of script class).
|
protected |
|
protected |
Application interpreter for running test scripts.
|
getsetprotected |
Name of the selected script type that is run.
If ScriptType is defined then this property is defined in accordance with it.
|
getsetprotected |
Selected type of the script to be run.
|
getsetprotected |
Script to be run.
|
get |
Gets name of the current user with all letters converted to lower case (in order to avoid ambiguities).
|
get |
Returns true if the current user logged on the computer is Igor, or false otherwise.
|
get |
Returns true if the current user logged on the computer is Tadej, or false otherwise.