Class CommandManager
Class responsible for managing interpreter commands.
Inherited Members
Namespace: DotNet.Interpreter.Helper
Assembly: DotNet.Interpreter.Helper.dll
Syntax
public class CommandManager
Remarks
Initializes a new instance of the CommandManager class.
Constructors
CommandManager(AbstractInterpreter)
Class responsible for managing interpreter commands.
Declaration
public CommandManager(AbstractInterpreter owner)
Parameters
Type | Name | Description |
---|---|---|
AbstractInterpreter | owner | Interpreter that owns this command manager. |
Remarks
Initializes a new instance of the CommandManager class.
Methods
Add(nint, ExecutionProcedureHandler)
Adds a new command to the execution array with an optional procedure call.
Declaration
public int Add(nint commandPtr, ExecutionProcedureHandler procedure = null)
Parameters
Type | Name | Description |
---|---|---|
nint | commandPtr | Pointer to the command. |
ExecutionProcedureHandler | procedure | Procedure to be called after successful command addition (optional). |
Returns
Type | Description |
---|---|
int | Index of the added command or |
InsertBefore(nint, nint)
Inserts a command before the specified command.
Declaration
public int InsertBefore(nint beforeCommandPtr, nint commandPtr)
Parameters
Type | Name | Description |
---|---|---|
nint | beforeCommandPtr | Pointer to the command before which the new command will be inserted. |
nint | commandPtr | Pointer to the command to be inserted. |
Returns
Type | Description |
---|---|
int | Index of the inserted command or |
IsActive(Register, ValueValidationProcedureHandler)
Checks if a register is active and its value satisfies the specified condition.
Declaration
public bool IsActive(Register register, ValueValidationProcedureHandler validationProcedure)
Parameters
Type | Name | Description |
---|---|---|
Register | register | Register to check. |
ValueValidationProcedureHandler | validationProcedure | Delegate that defines the validation condition for the register value. |
Returns
Type | Description |
---|---|
bool |
|
IsActive(nint)
Checks if a command is active by its pointer.
Declaration
public bool IsActive(nint commandPtr)
Parameters
Type | Name | Description |
---|---|---|
nint | commandPtr | Pointer to the command. |
Returns
Type | Description |
---|---|
bool |
|
IsActive(string, double[])
Checks if a register with the specified name and (optionally) value is active.
Declaration
[Obsolete("Use other overloaded IsActive methods instead")]
public bool IsActive(string registerName, double[] expectedValues = null)
Parameters
Type | Name | Description |
---|---|---|
string | registerName | Register name. |
double[] | expectedValues | Expected register values (if null or empty array, value validation is not performed). |
Returns
Type | Description |
---|---|
bool |
|
IsValueInArray(double, double[])
Checks if a specified floating-point number exists in an array of floating-point numbers.
Declaration
public static bool IsValueInArray(double value, double[] values)
Parameters
Type | Name | Description |
---|---|---|
double | value | Floating-point number to search for. |
double[] | values | Array of floating-point numbers to search in. |
Returns
Type | Description |
---|---|
bool |
|