| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties

# IG::Lib::ApplicationCommandlineBase Class Reference

Base class for main application classes containing main method of application, based on command line interpreter. More...

Inheritance diagram for IG::Lib::ApplicationCommandlineBase:
[legend]
Collaboration diagram for IG::Lib::ApplicationCommandlineBase:
[legend]

List of all members.

## Public Member Functions
| ApplicationCommandlineBase ()
| Constructor.
virtual void | AddDefaultAssemblies ()
| Adds assemblies to be automatically referenced by loaded scripts.
abstract void | TestMain (string[] args)
| Runs tests from scripts according to hard-coded settings. Standard form of test applications for functionality based on IGLib.
virtual void | AplicationMain (string[] args)
| Default main method for the current application.
## Public Attributes
string | OptDir
| Optimization directory that contains data and message files of optimization server.
## 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. 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.
abstract CommandLineApplicationInterpreter | CreateInterpreter ()
| Creates and returns application's command-line interpreter.
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.
virtual void | SetScriptNumArguments (int numArguments)
| 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.
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.
virtual string | GetScriptArgument (int whichArgument)
| Gets the specified string arguments, as it is currently set.
## Protected Attributes
const string | ConstScriptTests = "ScriptTests"
| Selecting constant fot TEST script. Test scripts typically include several example methods, which can be selected by the first command-line argument.
const string | ConstScriptCustomApp = "ScriptCustomApp"
| Selecting constant fot CUSTOM script.
const string | ConstInteractive = "Interactive"
| Selecting constant for interactive run.
string | ConstRunInteractive = "Interactive"
| Interpreter command for running in interactive mode.
string | ConstRunScript = "RunScript"
| Interpreter command for running dynamic scripts.
string | ScriptLocation = null
| Location of the script to be loaded.
string | ScriptGroupChoice
| Main selector for script that is run.
string | _scriptChoice
Type | _scriptType
string | ScriptAction
| Selector for script action.
string[] | DirectArguments = null
| Script arguments used when script is run directly by creating a script object.
string[] | InterpreterArguments = null
| Interpreter arguments used when script is run through interpreter.
string | DefaultActiveDir
| Default active directory. The current directory will be set to this directory.
ILoadableScript | _scriptToRun
bool | RunThroughInterpreter = false
| Whether script is loaded and run through interpreter (alternative is direct construction of script class).
string | _userNameLowerCase = null
CommandLineApplicationInterpreter | TestInterpreter
| Application interpreter for running test scripts.
## Properties
string | ScriptChoice`[get, set]`
| Name of the selected script type that is run. If ScriptType is defined then this property is defined in accordance with it.
Type | ScriptType`[get, set]`
| Selected type of the script to be run.
ILoadableScript | ScriptToRun`[get, set]`
| Script to be run.
virtual string | UserNameLowerCase`[get]`
| Gets name of the current user with all letters converted to lower case (in order to avoid ambiguities).
virtual bool | IsUserIgor`[get]`
| Returns true if the current user logged on the computer is Igor, or false otherwise.
virtual bool | IsUserTadej`[get]`
| Returns true if the current user logged on the computer is Tadej, or false otherwise.

## Detailed Description

Base class for main application classes containing main method of 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;

## Constructor & Destructor Documentation

IG::Lib::ApplicationCommandlineBase::ApplicationCommandlineBase | ( |  | ) | `[inline]`

Constructor.

## Member Function Documentation

virtual void IG::Lib::ApplicationCommandlineBase::SetUserName | ( | string | userName | ) | `[inline, protected, virtual]`

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.

Parameters:

  username | Name of the user to be set. Null annihilates previous calls and causes that system provided user name is returned by subsequent queries.

abstract CommandLineApplicationInterpreter IG::Lib::ApplicationCommandlineBase::CreateInterpreter | ( |  | ) | `[protected, pure virtual]`

Creates and returns application's command-line interpreter.

Implemented in IG::Lib::ShellApplication< InterpreterType >, and IG::Lib::LoadableScriptBase::StoredScriptSettings.

virtual void IG::Lib::ApplicationCommandlineBase::AddDefaultAssemblies | ( |  | ) | `[inline, virtual]`

Adds assemblies to be automatically referenced by loaded scripts.

Reimplemented in IG::Lib::ShellApplication< InterpreterType >.

int IG::Lib::ApplicationCommandlineBase::GetScriptNumArguments | ( |  | ) | `[inline, protected]`

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.

virtual void IG::Lib::ApplicationCommandlineBase::SetScriptNumArguments | ( | int | numArguments | ) | `[inline, protected, virtual]`

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.

Parameters:

  numArguments |

virtual void IG::Lib::ApplicationCommandlineBase::SetScriptArgument | ( | int | whichArgument,
|  | string | argumentValue
| ) |  | `[inline, protected, virtual]`

Sets the specified script argument; updates array of arguments for running script directly as well as arguments for running script through interpreter.

Parameters:

  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;

virtual string IG::Lib::ApplicationCommandlineBase::GetScriptArgument | ( | int | whichArgument | ) | `[inline, protected, virtual]`

Gets the specified string arguments, as it is currently set.

Parameters:

  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.

abstract void IG::Lib::ApplicationCommandlineBase::TestMain | ( | string[] | args | ) | `[pure virtual]`

Runs tests from scripts according to hard-coded settings. Standard form of test applications for functionality based on IGLib.

Parameters:

  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::Lib::ShellApplication< InterpreterType >, and IG::Lib::LoadableScriptBase::StoredScriptSettings.

virtual void IG::Lib::ApplicationCommandlineBase::AplicationMain | ( | string[] | args | ) | `[inline, virtual]`

Default main method for the current application.

Parameters:

  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 >.

## Member Data Documentation

const string IG::Lib::ApplicationCommandlineBase::ConstScriptTests = "ScriptTests"`[protected]`

Selecting constant fot TEST script. Test scripts typically include several example methods, which can be selected by the first command-line argument.

const string IG::Lib::ApplicationCommandlineBase::ConstScriptCustomApp = "ScriptCustomApp"`[protected]`

Selecting constant fot CUSTOM script.

const string IG::Lib::ApplicationCommandlineBase::ConstInteractive = "Interactive"`[protected]`

Selecting constant for interactive run.

string IG::Lib::ApplicationCommandlineBase::ConstRunInteractive = "Interactive"`[protected]`

Interpreter command for running in interactive mode.

string IG::Lib::ApplicationCommandlineBase::ConstRunScript = "RunScript"`[protected]`

Interpreter command for running dynamic scripts.

string IG::Lib::ApplicationCommandlineBase::ScriptLocation = null`[protected]`

Location of the script to be loaded.

string IG::Lib::ApplicationCommandlineBase::ScriptGroupChoice`[protected]`

Main selector for script that is run.

string IG::Lib::ApplicationCommandlineBase::_scriptChoice`[protected]`

Type IG::Lib::ApplicationCommandlineBase::_scriptType`[protected]`

string IG::Lib::ApplicationCommandlineBase::ScriptAction`[protected]`

Selector for script action.

string [] IG::Lib::ApplicationCommandlineBase::DirectArguments = null`[protected]`

Script arguments used when script is run directly by creating a script object.

string [] IG::Lib::ApplicationCommandlineBase::InterpreterArguments = null`[protected]`

Interpreter arguments used when script is run through interpreter.

string IG::Lib::ApplicationCommandlineBase::DefaultActiveDir`[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.

ILoadableScript IG::Lib::ApplicationCommandlineBase::_scriptToRun`[protected]`

bool IG::Lib::ApplicationCommandlineBase::RunThroughInterpreter = false`[protected]`

Whether script is loaded and run through interpreter (alternative is direct construction of script class).

string IG::Lib::ApplicationCommandlineBase::_userNameLowerCase = null`[protected]`

CommandLineApplicationInterpreter IG::Lib::ApplicationCommandlineBase::TestInterpreter`[protected]`

Application interpreter for running test scripts.

## Property Documentation

string IG::Lib::ApplicationCommandlineBase::ScriptChoice`[get, set, protected]`

Name of the selected script type that is run. If ScriptType is defined then this property is defined in accordance with it.

Type IG::Lib::ApplicationCommandlineBase::ScriptType`[get, set, protected]`

Selected type of the script to be run.

ILoadableScript IG::Lib::ApplicationCommandlineBase::ScriptToRun`[get, set, protected]`

Script to be run.

virtual string IG::Lib::ApplicationCommandlineBase::UserNameLowerCase`[get]`

Gets name of the current user with all letters converted to lower case (in order to avoid ambiguities).

virtual bool IG::Lib::ApplicationCommandlineBase::IsUserIgor`[get]`

Returns true if the current user logged on the computer is Igor, or false otherwise.

virtual bool IG::Lib::ApplicationCommandlineBase::IsUserTadej`[get]`

Returns true if the current user logged on the computer is Tadej, or false otherwise.

The documentation for this class was generated from the following file:

- ApplicationCommandLineBase.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events