IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for all command line interpreters. More...
Public Member Functions | |
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 | AddCommand (string commandName, CommandLine command, string referenceDescription) |
Adds a new command to the interpreter. If the command with the specified name already exists then the command is replaced. More... | |
override void | AddCommand (string commandName, CommandLine command) |
Adds a new command to the interpreter. If the command with the specified name already exists then the command is replaced. More... | |
void | RemoveCommand (string commandName) |
Removes the specified command reference from the interpreter. More... | |
void | RenameCommand (string oldCommandName, string newCommandName) |
Renames the specified command. More... | |
virtual void | Dispose () |
Clean up after the reference is not used any more. More... | |
Public Member Functions inherited from IG.Lib.InterpreterBase< TCommand, TCommandData > | |
abstract void | AddCommand (string commandName, TCommand command) |
Protected Member Functions | |
CommandLine | GetCommand (string commandName) |
Returns the command that is registered under the specified name, or null if there is no such command. More... | |
Properties | |
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 < CommandLineInterpreter > | ObjectRegister [get] |
Gets object register where the current object is registered. More... | |
SortedDictionary< string, CommandLine > | Commands [get] |
char | Separator [get, protected set] |
Properties inherited from IG.Lib.ILockable | |
object | Lock [get] |
Properties inherited from IG.Lib.IRegisterable< T > | |
ObjectRegister< T > | ObjectRegister [get] |
Gets the object register where the current object can be registered. More... | |
Properties inherited from IG.Lib.IIdentifiable | |
int | Id [get] |
Returns unique ID (in the scope of a given type) of the current object. More... | |
Private Member Functions | |
~CommandLineInterpreter () | |
Private Attributes | |
object | _mainLock = new object() |
IdProxy | _idPproxy |
Proxy object that implements the IIdentifiable interface for this object. More... | |
SortedDictionary< string, CommandLine > | _commands = new SortedDictionary<string,CommandLine>() |
char | _separator = ',' |
Static Private Attributes | |
static ObjectRegister < CommandLineInterpreter > | _register |
Static object that providees object register and generates IDs for this class: More... | |
Base class for all command line interpreters.
|
inlineprivate |
|
inline |
Registers the current object. Subsequent calls (after the first one) have no effect.
Implements IG.Lib.IRegisterable< T >.
|
inline |
Returns true if the current object is registered, false if not.
Implements IG.Lib.IRegisterable< T >.
|
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 >.
|
inline |
Adds a new command to the interpreter. If the command with the specified name already exists then the command is replaced.
commandName | Command name through which interpreter will be able to invoke the command. |
command | Command to be added to the interpreter. |
referenceDescription | Description of command reference (data structure that includes the command, interpreter where command is installed, and name under which command is registered on the interpretere). These data are used in order to know when command is not referenced any more, so its finalization block can be performed. |
References IG.Lib.CommandLine.AddCommandReference().
|
inline |
Adds a new command to the interpreter. If the command with the specified name already exists then the command is replaced.
commandName | Command name through which interpreter will be able to invoke the command. |
command | Command to be added to the interpreter. |
|
inline |
Removes the specified command reference from the interpreter.
commandName | Name that identifies the command on this interpreter. Note that any command can be registered under different names, but each command name references only one command. |
References IG.Lib.CommandLine.RemoveCommandReference().
|
inline |
Renames the specified command.
oldCommandName | |
newCommandName |
|
inlineprotected |
Returns the command that is registered under the specified name, or null if there is no such command.
commandName | Command name. Must not be null or empty string! |
|
inlinevirtual |
Clean up after the reference is not used any more.
|
private |
|
staticprivate |
Static object that providees object register and generates IDs for this class:
|
private |
Proxy object that implements the IIdentifiable interface for this object.
|
private |
|
private |
|
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.
|
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.
|
get |
Gets object register where the current object is registered.
|
getprotected |
|
getprotected set |