IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Contains stack frames and other command thread data for a single command thread of a command-line interreter. More...
Public Member Functions | |
CommandThread (InterpreterType interpreter) | |
override ICommandLineApplicationInterpreter | GetInterpreterBase () |
Returns the commans-line interpreter to which the current command thread belongs. More... | |
override CommandStackFrameBase | GetStackFrameBase (int level) |
Returns the stack frame of the specified level for the current thread. More... | |
FrameType | AddFrame (CodeBlockType blockType) |
Adds a new stack frame. More... | |
FrameType | RemoveFrame () |
Removes the last stack frame. More... | |
![]() | |
CommandThreadBase () | |
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... | |
Protected Member Functions | |
abstract FrameType | CreateFrame (CodeBlockType type, int stackLevel) |
![]() | |
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... | |
Properties | |
InterpreterType | Interpreter [get, protected set] |
Returns interpreter that handles command execution on the current command thread. More... | |
List< FrameType > | StackFrames [get] |
A list of stack frames existent in the current thread. More... | |
FrameType | BaseFrame [get, protected set] |
Base stack frame, created when the thread is initialized and exists until thread is exited. More... | |
FrameType | TopFrame [get, protected set] |
Base stack frame, created when the thread is initialized and exists until thread is exited. More... | |
FrameType | this[int which] [get] |
![]() | |
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... | |
![]() | |
int | Id [get] |
Returns unique ID (in the scope of a given type) of the current object. More... | |
![]() | |
object | Lock [get] |
Private Member Functions | |
CommandThread () | |
Private Attributes | |
InterpreterType | _interpreter |
List< FrameType > | _stackFrames = new List<FrameType>() |
FrameType | _baseFrame = null |
FrameType | _topFrame = null |
Additional Inherited Members | |
![]() | |
StopWatch1 | _timer |
![]() | |
static int | GetNextIdThread () |
Returns another ID that is unique for objects of the containing class its and derived classes. More... | |
![]() | |
int | _outputLevel = DefaultOutputLevel |
Default level of output for some of the interpreters' functionality (e.g. asynchronous command execution). More... | |
Contains stack frames and other command thread data for a single command thread of a command-line interreter.
Usually properties, index operators and methods are not thread safe. Variants whose names end with "Locked" implement locking on the CommandThreadBase.Lock property and are thus thread safe. It is not likely that locking is needed because the object will typically be used within a single thread.
InterpreterType | Type of the interpreter for which this class provides command thread data. |
FrameType | Type of stack frames that is combined with this type. |
ThreadType | Type of command thread data - represents this very type, to make it easier to use the frame type (which, in turn, has a type parameter for thread type). |
$A Igor Sep15;
InterpreterType | : | class | |
InterpreterType | : | ICommandLineApplicationInterpreter | |
FrameType | : | CommandStackFrame | |
FrameType | : | InterpreterType | |
FrameType | : | ThreadType | |
ThreadType | : | CommandThread | |
ThreadType | : | InterpreterType | |
ThreadType | : | FrameType | |
ThreadType | : | ThreadType |
|
inlineprivate |
|
inline |
|
inlinevirtual |
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.
Implements IG.Lib.CommandThreadBase.
|
inlinevirtual |
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.
Implements IG.Lib.CommandThreadBase.
|
protectedpure virtual |
Implemented in IG.Lib.CommandThread< InterpreterType >.
|
inline |
Adds a new stack frame.
blockType | Type of the code block represented by the stack frame. |
|
inline |
Removes the last stack frame.
|
private |
|
private |
|
private |
|
private |
|
getprotected set |
Returns interpreter that handles command execution on the current command thread.
|
getprotected |
A list of stack frames existent in the current thread.
|
getprotected set |
Base stack frame, created when the thread is initialized and exists until thread is exited.
|
getprotected set |
Base stack frame, created when the thread is initialized and exists until thread is exited.
|
get |