IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Lib.CommandStackFrame< InterpreterType, ThreadType > Class Template Referenceabstract

Stack frame for a block of command-line interpreter commands. More...

+ Inheritance diagram for IG.Lib.CommandStackFrame< InterpreterType, ThreadType >:
+ Collaboration diagram for IG.Lib.CommandStackFrame< InterpreterType, ThreadType >:

Public Member Functions

 CommandStackFrame (CodeBlockType blockType, ThreadType thread, int stackLevel)
 Constructor, sets the block type. More...
 
override
ICommandLineApplicationInterpreter 
GetInterpreterBase ()
 Returns the commans-line interpreter to which the current command thread belongs. More...
 
override CommandThreadBase GetThreadBase ()
 Returns the stack frame of the specified level for the current thread. More...
 
abstract CommandStackFrame
< InterpreterType, ThreadType > 
GetThreadStackFrame (int stackLevel)
 Returns the sibling stack frame of the specified level. More...
 
abstract CommandStackFrame
< InterpreterType, ThreadType > 
GetParentStackFrame ()
 Returns the previous (parent, or one lower level) stack frame of the current stack frame. More...
 
- Public Member Functions inherited from IG.Lib.CommandStackFrameBase
 CommandStackFrameBase ()
 
void AddBlockEnterCommands (params string[] commands)
 Adds the specified strings to the list of commands that can enter the current kind of the code block. More...
 
void AddBlockExitCommands (params string[] commands)
 Adds the specified strings to the list of commands that can exit the current kind of the code block. More...
 
void AddBlockExitCommandsNoLevelEffect (params string[] commands)
 Adds the specified strings to the list of commands that can exit the current kind of the code block, but don't affect the quiet entry/exit level. More...
 
string[] GetBlockEnterCommands ()
 Returns the array of commands that can enter the current kind of code block. More...
 
string[] GetBlockExitCommands ()
 Returns the array of commands that can exit the current kind of code block. More...
 
string[] GetBlockExitCommandsNoLevelEffect ()
 Returns the array of commands that can exit the current kind of code block but have no level effect. More...
 
bool IsEventualBlockEnterCommand (string commandLine, bool isOnlyCommandName=false)
 Returns true if the specified commandline can eventually represent one of the commands contained in the list of possible block enter commands for the current kind of code block. More...
 
bool IsEventualBlockExitCommand (string commandLine, bool isOnlyCommandName=false)
 Returns true if the specified commandline can eventually represent one of the commands contained in the list of possible block exit commands for the current kind of code block. More...
 
bool IsEventualBlockExitCommandNoLevelEffect (string commandLine, bool isOnlyCommandName=false)
 Returns true if the specified commandline can eventually represent one of the commands contained in the list of possible block exit commands that do not affect quiet entry/exit level, for the current kind of code block. More...
 
bool CheckForBlockEnterOrExitCommand (string commandLine, bool justCheck=false, bool isOnlyCommandName=false)
 Inspects the specified commandline and checks whether it can represent a block enter or a block exit command for the currennt code block. More...
 
bool IsBlockExitQuietCommand (string commandLine, bool isOnlyCommandName=false)
 Returns true if the specified command should be executed as block exit command, in spite of the fact that commannd execution is currently switched off on the current code block. More...
 
bool IsVariableDefined (string varName)
 Returns true if the specified variable is defined, false if it is not. More...
 
bool IsVariableDefinedLocked (string varName)
 Returns true if the specified variable is defined, false if it is not. More...
 
InterpreterVariable GetVariableDef (string varName)
 Returns variable object (definition) for the variable with specified name. More...
 
string GetVariableValue (string varName)
 Returns value of the specified variable. More...
 
string GetVariableValueLocked (string varName)
 Gets the variable within lock on the Lock property and returns it. More...
 
void SetVariableValue (string varName, string varValue, VariableFlags flags=VariableFlags.Default)
 Sets value of the specified variable. More...
 
void SetVariableValueLocked (string varName, string varValue, VariableFlags flags=VariableFlags.Default)
 Sets the variable within lock on the property. More...
 
void RemoveVariable (string varName)
 Removes the specified variable. More...
 
void RemoveVariableLocked (string varName)
 Removes the specified variable within lock on the property. More...
 
string ToStringVariableNames ()
 
string ToStringVariableValues ()
 
virtual string ToString (bool includeThreadInfo=true, bool includeLocalVariables=true, bool includeGlobalVariables=true)
 Returns a string containing information about the current command thread. More...
 
override string ToString ()
 Returns string representation of the current object. More...
 

Properties

ThreadType InterpreterThread [get, protected set]
 Interpretation thread that contains the current stack frame. More...
 
abstract InterpreterType Interpreter [get]
 Returns the commandline interpreter of the crrent stack frame. More...
 
- Properties inherited from IG.Lib.CommandStackFrameBase
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...
 
int StackLevel [get, protected set]
 
List< string > BlockEnterCommands [get]
 A list of commands that can enter the type of the current code block. More...
 
List< string > BlockExitCommands [get]
 A list of commands that can exit the type of the current code block. More...
 
List< string > BlockExitCommandsNoLevelEffect [get]
 A list of commands that can exit the type of the current code block, but willl nnot have effect on the quet wxit/entry level. More...
 
int QuietBlockEntryLevel [get, protected set]
 Indicates the quiet entry/exit level of the current kind of block when commands are not executed. More...
 
CodeBlockType BlockType [get, protected set]
 Type of the code block represented by the current stack frame. More...
 
bool DoExecuteCommands [get, set]
 Whether commands are executed in the current code block. More...
 
bool WasBranchAlreadyExecuted [get, set]
 Whether a branch has already been executed. More...
 
int NumExitLevels [get, set]
 
int LoopCount [get, set]
 Whether commands are executed in the current code block. More...
 
bool SuppressInteractive [get, set]
 Indicates that the interactive mode is temporarily represset. More...
 
string ConditionExpression [get, set]
 For loopig and branching blocks, this property contains the condition expression of the block, which was a part of the block command (such as While, If, or ElseIf). More...
 
string BlockCommanddLine [get, set]
 Commandline that started the current block. It may have been saved when the current block of code was entered, in order to be used within the block (e.g. for inspection and debugging) or when the block exits. Typical use is in blocks with deferred evaluation, such as in While block, where commandlines within the block are stored first, and then repeatedly evaluated until the condition from the While block entering command is fulfilled. More...
 
bool DoSaveCommands [get, set]
 Whether commands are saved to the command store in the current code block. More...
 
List< string > CommandLines [get]
 
string LastCommandLine [get, set]
 
string ReturnedValue [get, set]
 Value returned from the last executed command. More...
 
string[] VariableNames [get]
 Gets names of all variables that are defined on the current stack frame. More...
 
string[] VariableValueStrings [get]
 Gets names of all variables that are defined on the current stack frame. More...
 
InterpreterVariable this[string variableName] [get, set]
 Gets or sets value of the variable with the specified name. More...
 

Private Member Functions

 CommandStackFrame ()
 Prevent default constructor of being called. More...
 

Private Attributes

ThreadType _interpreterThread = null
 

Additional Inherited Members

- Protected Member Functions inherited from IG.Lib.CommandStackFrameBase
bool IsEventualListedCommand (string commandLine, List< string > commands, bool isOnlyCommandName=false)
 Returns true if the specified commandline can eventually represent one of the commands contained in the specified list of commands. More...
 
- Protected Attributes inherited from IG.Lib.CommandStackFrameBase
int _quietBlockLevel = 0
 
SortedDictionary< string,
InterpreterVariable
_variables = new SortedDictionary<string, InterpreterVariable>()
 Local variables. More...
 
List< string > _auxVarNames = null
 

Detailed Description

Stack frame for a block of command-line interpreter commands.

Usually properties, index operators and methods are not thread safe. Variants whose names end with "Locked" implement locking on the CommandStackFrameBase.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.

Template Parameters
InterpreterTypeType of the interpreter for which this class provides a stack frame.
ThreadTypeType of the thread object on which the stack frames are installed.

$A Igor Sep15;

Type Constraints
InterpreterType :class 
InterpreterType :ICommandLineApplicationInterpreter 
ThreadType :CommandThreadBase 

Constructor & Destructor Documentation

IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.CommandStackFrame ( )
inlineprivate

Prevent default constructor of being called.

References IG.Lib.None.

IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.CommandStackFrame ( CodeBlockType  blockType,
ThreadType  thread,
int  stackLevel 
)
inline

Constructor, sets the block type.

Parameters
blockTypeType of the code block represented by the current stack frame.
threadCommand thread on which this frame is installed.
stackLevelStack level of the current stack frame (growing from 0 upwards).

Member Function Documentation

override ICommandLineApplicationInterpreter IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.GetInterpreterBase ( )
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.CommandStackFrameBase.

override CommandThreadBase IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.GetThreadBase ( )
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.

Implements IG.Lib.CommandStackFrameBase.

abstract CommandStackFrame<InterpreterType, ThreadType> IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.GetThreadStackFrame ( int  stackLevel)
pure virtual

Returns the sibling stack frame of the specified level.

Parameters
stackLevelLevel of the sibling stack frame.

Implemented in IG.Lib.CommandStackFrame< InterpreterType >.

abstract CommandStackFrame<InterpreterType, ThreadType> IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.GetParentStackFrame ( )
pure virtual

Returns the previous (parent, or one lower level) stack frame of the current stack frame.

Implemented in IG.Lib.CommandStackFrame< InterpreterType >.

Member Data Documentation

ThreadType IG.Lib.CommandStackFrame< InterpreterType, ThreadType >._interpreterThread = null
private

Property Documentation

ThreadType IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.InterpreterThread
getprotected set

Interpretation thread that contains the current stack frame.

abstract InterpreterType IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.Interpreter
get

Returns the commandline interpreter of the crrent stack frame.


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