IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for interpreter variables. More...
Public Member Functions | |
InterpreterVariable (string variableName, int stackLevel=StackLevelDefault, string variableValue=null, VariableFlags flags=VariableFlags.Default) | |
Constructs a new interpreter variable. More... | |
void | SetReferencedVariable (InterpreterVariable referencedVariable, string referencedVariableName=null, int referencedVariableStackLevel=StackLevelDefault) |
Sets the the variable reference, which defines the variable that the current variable references. More... | |
override string | ToString () |
Returns a string that describes the current interpreter variable. More... | |
Public Attributes | |
const int | StackLevelGlobal = -1 |
Stack level used for global variables. More... | |
const int | StackLevelUndefined = -2 |
Stack level used for variables that are neither local or global (or for which stack level is unknown). More... | |
const int | StackLevelDefault = StackLevelUndefined |
Default stack level - StackLevelUndefined More... | |
Properties | |
string | Name [get, protected set] |
Variable name. More... | |
int | StackLevel [get, protected set] |
Specifies the stack level of the local variable and whether the variable is local or global. More... | |
bool | IsGlobal [get] |
Gets a flag indicating whether the current variable is a global variable. More... | |
bool | IsLocal [get] |
Gets a flag indicating whether the current variable is a global variable. More... | |
string | StringValue [get, set] |
String value of the variable. More... | |
VariableFlags | Flags [get, protected set] |
Flags that define type and behavior of the variable. More... | |
bool | IsValid [get, set] |
Indicates whether the variable is valid and can be used (i.e., is defined). More... | |
bool | IsReference [get, protected set] |
Indicates whether the variable is a reference to another variable. More... | |
InterpreterVariable | ReferencedVariable [get, protected set] |
Reference to the variable that is referenced by the current variable. More... | |
int | ReferencedVariableStackLevel [get, protected set] |
Gets the stack level of the referenced variable. More... | |
string | ReferencedVariableName [get, protected set] |
Gets the referenced variable name. More... | |
bool | IsReferencedVariableLocal [get] |
Gets a flag indicating whether the current variable references a local variable. More... | |
bool | IsReferencedVariableGlobal [get] |
Gets a flag indicating whether the current variable references a global variable. More... | |
int | ReferencedVariableLevelsBelow [get] |
Gets the number of stack levels for which the referenced variable is defined below the current variable. More... | |
Private Member Functions | |
InterpreterVariable () | |
Private Attributes | |
string | _variableName |
int | _stackLevel = -1 |
string | _stringValue |
VariableFlags | _flags = VariableFlags.Default |
InterpreterVariable | _referencedVar |
int | _referencedVariableStackLevel = StackLevelDefault |
string | _referencedVariableName = null |
Base class for interpreter variables.
$A Igor Oct15;
|
inlineprivate |
|
inline |
Constructs a new interpreter variable.
variableName | Variable name. Must be specified. |
stackLevel | Stack level. |
variableValue | String value of the variable. Can be null. |
flags | Flags that define type and behavior of the variable. Default is VariableFlags.Default |
|
inline |
Sets the the variable reference, which defines the variable that the current variable references.
Exception is thrown if the current variable is not a reference variable.
referencedVariable | Variable that will be referenced by the current variable. |
Normally, this is required information for reference variables, but can be set undefined.
referencedVariableName | Name of the referenced variable. This is auxiliary information and is usually provided only when the name referencedVariable is not specified (i.e., it is a null reference). |
referencedVariableStackLevel | The stack level of the referenced variable. |
|
inline |
Returns a string that describes the current interpreter variable.
|
private |
|
private |
const int IG.Lib.InterpreterVariable.StackLevelGlobal = -1 |
Stack level used for global variables.
const int IG.Lib.InterpreterVariable.StackLevelUndefined = -2 |
Stack level used for variables that are neither local or global (or for which stack level is unknown).
const int IG.Lib.InterpreterVariable.StackLevelDefault = StackLevelUndefined |
Default stack level - StackLevelUndefined
|
private |
|
private |
|
private |
|
private |
|
private |
|
getprotected set |
Variable name.
Normally, this will coincide with the name through which the variable is referenced in the interpreter.
|
getprotected set |
Specifies the stack level of the local variable and whether the variable is local or global.
Greater or equal to 0 means that the variable is a local variable defined on the stack frame of the specified level.
-1 means that the variable is global.
Less than -1 meand that the variable is neither local nor global (usually, this indicates an error).
|
getprivate |
Gets a flag indicating whether the current variable is a global variable.
|
getprivate |
Gets a flag indicating whether the current variable is a global variable.
|
getset |
String value of the variable.
Variables of the commandline interpreter (ICommandLineApplicationInterpreter) normally have string values.
Referenced by IG.Lib.CommandStackFrameBase.SetVariableValue(), and IG.Lib.CommandStackFrameBase.SetVariableValueLocked().
|
getprotected set |
Flags that define type and behavior of the variable.
Referenced by IG.Lib.CommandStackFrameBase.SetVariableValue(), and IG.Lib.CommandStackFrameBase.SetVariableValueLocked().
|
getset |
Indicates whether the variable is valid and can be used (i.e., is defined).
Can be get and set.
When a variable is removed, its valid flag will be set to false. In this way, variables that evantually reference this variable will know that their reference is invalid.
|
getprotected set |
Indicates whether the variable is a reference to another variable.
|
getprotected set |
Reference to the variable that is referenced by the current variable.
|
getprotected set |
Gets the stack level of the referenced variable.
InvalidOperationException | Thrown when the current variable is not a reference to another variable. |
|
getprotected set |
Gets the referenced variable name.
InvalidOperationException | Thrown when the current variable is not a reference to another variable. |
|
get |
Gets a flag indicating whether the current variable references a local variable.
InvalidOperationException | Thrown when the current variable is not a reference to another variable. |
InvalidOperationException | Thrown when the current variable is not a reference to another variable. |
|
get |
Gets a flag indicating whether the current variable references a global variable.
InvalidOperationException | Thrown when the current variable is not a reference to another variable. |
|
get |
Gets the number of stack levels for which the referenced variable is defined below the current variable.
InvalidOperationException | Thrown when the current variable is not a reference to another variable, or the referenced variable is not a local variable, or the current variable is not a local variable.. |