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 > Class Template Reference

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

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

Public Member Functions

 CommandStackFrame (CodeBlockType blockType, CommandThread< InterpreterType > thread, int stackLevel)
 Constructor. More...
 
override CommandStackFrame
< InterpreterType,
CommandThread< InterpreterType > > 
GetThreadStackFrame (int stackLevel)
 Returns the sibling stack frame at the certain level. More...
 
override CommandStackFrame
< InterpreterType,
CommandThread< InterpreterType > > 
GetParentStackFrame ()
 Returns the previous (parent, or one lower level) stack frame of the current stack frame. More...
 
- Public Member Functions inherited from IG.Lib.CommandStackFrame< InterpreterType, ThreadType >
 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...
 
- 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

override InterpreterType Interpreter [get]
 Returns the commandline interpreter of the crrent stack frame. More...
 
- Properties inherited from IG.Lib.CommandStackFrame< InterpreterType, ThreadType >
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...
 

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 stack frames.

$A Igor Sep15;

Type Constraints
InterpreterType :class 
InterpreterType :ICommandLineApplicationInterpreter 

Constructor & Destructor Documentation

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

Constructor.

Parameters
blockTypeType of the command block represented by the current stack frame.
threadCommand thread data that contains the current stack frame.
stackLevelStack level of the current frame.

Member Function Documentation

override CommandStackFrame<InterpreterType, CommandThread<InterpreterType> > IG.Lib.CommandStackFrame< InterpreterType >.GetThreadStackFrame ( int  stackLevel)
inlinevirtual

Returns the sibling stack frame at the certain level.

Parameters
stackLevelStack level for which the sibling frame is returned.
Returns

Implements IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.

override CommandStackFrame<InterpreterType, CommandThread<InterpreterType> > IG.Lib.CommandStackFrame< InterpreterType >.GetParentStackFrame ( )
inlinevirtual

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

Implements IG.Lib.CommandStackFrame< InterpreterType, ThreadType >.

Property Documentation

override InterpreterType IG.Lib.CommandStackFrame< InterpreterType >.Interpreter
get

Returns the commandline interpreter of the crrent stack frame.


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