IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for classes of type CommandThread{InterpreterType, FrameType, ThreadType}. Contains everything that is not dependent on generic frame and other parameters. More...
Public Member Functions | |
CommandThreadBase () | |
abstract ICommandLineApplicationInterpreter | GetInterpreterBase () |
Returns the commans-line interpreter to which the current command thread belongs. More... | |
abstract CommandStackFrameBase | GetStackFrameBase (int level) |
Returns the stack frame of the specified level for the current thread. More... | |
void | StorePrompt (string prompt) |
Stores a string (prompt) to the end of the list of stored prompts. More... | |
string | RestorePrompt () |
Restores a string (prompt) from the end of the list of stored prompts. More... | |
void | PushParameter (object param) |
Stores a new parameter at the end of the parameter store. More... | |
object | PopParameter () |
Removae and returns the last object on the parameter store. More... | |
object | GetParameterFromTop (int whichPlaceFromTop=0) |
Returns the stored parameter with the specified index from the top. More... | |
override string | ToString () |
Returns a string containing information about the current command thread. More... | |
Public Attributes | |
StopWatch1 | _timer |
Protected Member Functions | |
virtual void | SaveNumStoredParameters () |
Saves the current number of stored parameters on the command thread. More... | |
virtual void | RestorePreviousNumStoredParameters (CommandStackFrameBase frame) |
Saves the current number of stored parameters on the command thread. More... | |
Static Protected Member Functions | |
static int | GetNextIdThread () |
Returns another ID that is unique for objects of the containing class its and derived classes. More... | |
Protected Attributes | |
int | _outputLevel = DefaultOutputLevel |
Default level of output for some of the interpreters' functionality (e.g. asynchronous command execution). More... | |
Properties | |
int | TopFrameIndex [get, protected set] |
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... | |
static object | LockIdThread [get] |
Lock used for acquiring IDs. More... | |
virtual int | Id [get] |
Unique ID for objects of the currnet and derived classes. More... | |
bool | WasCommandExecuted [get, set] |
Auxiliary flag that indicates whether the last command launched on the current thread has actually been executed. More... | |
bool | WasBlockEnterCommand [get, set] |
Auxiliary flag that indicates whether the last executed command was a block enter command. More... | |
bool | WasBlockExitCommand [get, set] |
Auxiliary flag that indicates whether the last executed command was a block exit command. More... | |
List< String > | StoredPrompts [get] |
Auxiliary list where calling environment can store prompts used e.g. in interactive mode More... | |
List< object > | ParameterStore [get] |
Stored objects. More... | |
int | NumStoredParameters [get] |
bool | SuppressInteractive [get, set] |
Indicates that the interactive mode is temporarily represset. More... | |
static int | DefaultOutputLevel [get, set] |
bool | IsOutputLevelSet [get, protected set] |
virtual int | OutputLevel [get, set] |
Level of output for some of the interpreter's functionality (e.g. asynchronous command execution). More... | |
StopWatch1 | Timer [get] |
Gets the stopwatch used for measuring time of commands. 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... | |
Properties inherited from IG.Lib.ILockable | |
object | Lock [get] |
Private Attributes | |
int | _topFrameIndex = -1 |
object | _mainLock = new object() |
int | _id = GetNextIdThread() |
bool | _wasCommandExecuted = false |
bool | _wasBlockEnterCommand = false |
bool | _wasBlockExitCommand = false |
List< string > | _storedPrompts = null |
List< object > | _parametersStore = null |
List< int > | _numParamsBeforeFrame = new List<int>() |
int | _lastNumStoredParameters = 0 |
int | _indexOfLastNumStoredParameters = -1 |
bool | _threadSuppressInteractive = false |
bool | _isOutputLevelSet = false |
Static Private Attributes | |
static object | _lockIdThread |
static int | _nextIdThread = 0 |
Base class for classes of type CommandThread{InterpreterType, FrameType, ThreadType}. Contains everything that is not dependent on generic frame and other parameters.
|
inline |
|
pure virtual |
Returns the commans-line interpreter to which the current command thread belongs.
WARNING: This method is intended for use in the base classes; use more specific (type dependent) methods in derived classes.
Implemented in IG.Lib.CommandThread< InterpreterType, FrameType, ThreadType >.
|
pure virtual |
Returns the stack frame of the specified level for the current thread.
WARNING: This method is intended for use in the base classes; use more specific (type dependent) methods in derived classes.
level | Level of the stack frame to be returned. |
Command thread (if not replicated for another one) begins executon at stack level 0, then each command block or function call increments the stack level by creating a new stack frame.
Implemented in IG.Lib.CommandThread< InterpreterType, FrameType, ThreadType >.
|
inlinestaticprotected |
Returns another ID that is unique for objects of the containing class its and derived classes.
|
inline |
Stores a string (prompt) to the end of the list of stored prompts.
Currently NOT USED!
prompt | Prompt string to be stored. |
|
inline |
Restores a string (prompt) from the end of the list of stored prompts.
Currently NOT USED!
|
inline |
Stores a new parameter at the end of the parameter store.
WARNING: Users must make sure that PushParameter and PopParameter are properrly called in pairs, otherwise parameter store will ger corrupted and unusable for otherr users.
param | Parameter that is added to parameter store. |
|
inline |
Removae and returns the last object on the parameter store.
WARNING: Users must make sure that PushParameter and PopParameter are properrly called in pairs, otherwise parameter store will ger corrupted and unusable for otherr users.
This method must be called on the same top-level stack frame on which the PushParameter for the corresponding stored parameter was called.
|
inline |
Returns the stored parameter with the specified index from the top.
This method allows to access parameters that are owned by parent frames (because the PopParameter method can not access parameters that were not added by the current frame).
whichPlaceFromTop | Specifies which stored parameter, in terms of the place from the top of the parameter stack downwards, should be obtained. Index 0 (default) specifies the last (top-most) parameter. |
|
inlineprotectedvirtual |
Saves the current number of stored parameters on the command thread.
This must be called when a new stack frame is added.
If called at other places, it must be consistently called in pair with RestorePreviousNumStoredParameters.
|
inlineprotectedvirtual |
Saves the current number of stored parameters on the command thread.
This must normally be called when a stack frame is removed.
If called at other places, it must be consistently called in pair with SaveNumStoredParameters.
References IG.Lib.CommandStackFrameBase.StackLevel.
|
inline |
Returns a string containing information about the current command thread.
References IG.Lib.ICommandLineApplicationInterpreter.GetCommmandThread(), and IG.Lib.ICommandLineApplicationInterpreter.NumCommandThreads.
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
Default level of output for some of the interpreters' functionality (e.g. asynchronous command execution).
StopWatch1 IG.Lib.CommandThreadBase._timer |
|
getprotected set |
|
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.
|
staticget |
Lock used for acquiring IDs.
|
get |
Unique ID for objects of the currnet and derived classes.
|
getset |
Auxiliary flag that indicates whether the last command launched on the current thread has actually been executed.
This flag is used for communication between the calling environment and the method that takes care of final invocation of commands.
|
getset |
Auxiliary flag that indicates whether the last executed command was a block enter command.
This flag is cleared when WasCommandExecuted is cleared, and is set by block entering commands themselves.
|
getset |
Auxiliary flag that indicates whether the last executed command was a block exit command.
This flag is cleared when WasCommandExecuted is cleared, and is set by block exiting commands themselves.
|
getprivate |
Auxiliary list where calling environment can store prompts used e.g. in interactive mode
Currently NOT USED!
|
getprivate |
Stored objects.
|
get |
|
getset |
Indicates that the interactive mode is temporarily represset.
|
staticgetset |
|
getprotected set |
|
getset |
Level of output for some of the interpreter's functionality (e.g. asynchronous command execution).
|
get |
Gets the stopwatch used for measuring time of commands.
This property always returns an initialized stopwatch.