Represents a single command-line that can be executed. $A Igor Feb09;
More...
|
| CommandLine () |
| Creates a new command that can be used in command-line interpreters. More...
|
|
void | Register () |
| Registers the current object. Subsequent calls (after the first one) have no effect. More...
|
|
bool | IsRegistered () |
| Returns true if the current object is registered, false if not. More...
|
|
void | Unregister () |
| Unregisters the current object if it is currently registered. Can be performed several times, in this case only the first call may have effect. More...
|
|
void | AddCommandReference (int interpreterId, string commandName, string description) |
| Adds a new command use reference for this command. This method should be called whenever the command in installed on some interpreter. An internal list is used to store all references to this command on various interpreters. Stored references are unique (i.e. pairs {InterpreterId, CommandName}). More...
|
|
void | RemoveCommandReference (int interpreterId, string commandName) |
| Removes command uage reference. This method should be called whenever a command is uninstalled form interpreter. More...
|
|
abstract void | Dispose () |
| Clean up after the reference is not used any more. More...
|
|
|
abstract void | Execute (CommandLineInterpreter interpreter, string command, string[] arguments) |
| Executes the current command. Warning: whenever the data on command object (i.e. this) or interpreter object is accessed, these objects must be locked! If such data is not accessed then locking is not necessary. More...
|
|
|
string | _command |
| Temporary storage of command name for execution in a new thread. More...
|
|
string[] | _arguments |
| Temporary storage of command arguments for execution in a new thread. More...
|
|
bool | _threadStarted |
| Flag used to signal that command data has been picked by the executing thread and so object access can be unlocked. More...
|
|
|
object | Lock [get] |
| This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
|
|
virtual int | Id [get] |
| Returns unique Id (in the scope of a given type) of the current object. Method is defined as virtual so that derived class can have its own IDs by defining its own static IdentifiableGenerator object. More...
|
|
ObjectRegister< CommandLine > | ObjectRegister [get] |
| Gets object register where the current object is registered. More...
|
|
object | Lock [get] |
|
ObjectRegister< T > | ObjectRegister [get] |
| Gets the object register where the current object can be registered. More...
|
|
int | Id [get] |
| Returns unique ID (in the scope of a given type) of the current object. More...
|
|
Represents a single command-line that can be executed. $A Igor Feb09;
IG.Lib.CommandLine.CommandLine |
( |
| ) |
|
|
inline |
Creates a new command that can be used in command-line interpreters.
IG.Lib.CommandLine.~CommandLine |
( |
| ) |
|
|
inlineprivate |
void IG.Lib.CommandLine.Register |
( |
| ) |
|
|
inline |
bool IG.Lib.CommandLine.IsRegistered |
( |
| ) |
|
|
inline |
void IG.Lib.CommandLine.Unregister |
( |
| ) |
|
|
inline |
Unregisters the current object if it is currently registered. Can be performed several times, in this case only the first call may have effect.
Implements IG.Lib.IRegisterable< T >.
void IG.Lib.CommandLine.AddCommandReference |
( |
int |
interpreterId, |
|
|
string |
commandName, |
|
|
string |
description |
|
) |
| |
|
inline |
Adds a new command use reference for this command. This method should be called whenever the command in installed on some interpreter. An internal list is used to store all references to this command on various interpreters. Stored references are unique (i.e. pairs {InterpreterId, CommandName}).
- Parameters
-
interpreterId | ID of the interpreter where command is installed. |
commandName | Command name under which the command is installed on this interpreter. |
description | Custom description of the specified reference, can be null. |
Referenced by IG.Lib.CommandLineInterpreter.AddCommand().
void IG.Lib.CommandLine.RemoveCommandReference |
( |
int |
interpreterId, |
|
|
string |
commandName |
|
) |
| |
|
inline |
abstract void IG.Lib.CommandLine.Execute |
( |
CommandLineInterpreter |
interpreter, |
|
|
string |
command, |
|
|
string[] |
arguments |
|
) |
| |
|
protectedpure virtual |
Executes the current command. Warning: whenever the data on command object (i.e. this) or interpreter object is accessed, these objects must be locked! If such data is not accessed then locking is not necessary.
- Parameters
-
interpreter | Interpreter that executed the command. |
command | Command name under which the command is executed. A single command instance can be installed under several names on the interpreter. |
arguments | Arguments of the command. |
abstract void IG.Lib.CommandLine.Dispose |
( |
| ) |
|
|
pure virtual |
Clean up after the reference is not used any more.
object IG.Lib.CommandLine._mainLock = new object() |
|
private |
Initial value:=
new ObjectRegister<CommandLine>(1 )
Static object that providees object register and generates IDs for this class:
IdProxy IG.Lib.CommandLine._idPproxy |
|
private |
Initial value:
Proxy object that implements the IIdentifiable interface for this object.
Initial value:=
new SortedDictionary<CommandUseReference, string>()
string IG.Lib.CommandLine._command |
|
protected |
Temporary storage of command name for execution in a new thread.
string [] IG.Lib.CommandLine._arguments |
|
protected |
Temporary storage of command arguments for execution in a new thread.
bool IG.Lib.CommandLine._threadStarted |
|
protected |
Flag used to signal that command data has been picked by the executing thread and so object access can be unlocked.
object IG.Lib.CommandLine.Lock |
|
get |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
virtual int IG.Lib.CommandLine.Id |
|
get |
Returns unique Id (in the scope of a given type) of the current object. Method is defined as virtual so that derived class can have its own IDs by defining its own static IdentifiableGenerator object.
ObjectRegister<CommandLine> IG.Lib.CommandLine.ObjectRegister |
|
get |
Gets object register where the current object is registered.
The documentation for this class was generated from the following file: