Public Member Functions | Data Fields

# SignalIf::PseudoInstruction Class Reference

The If-Else and If-Endif pseudo instructions. More...

`#include <programmable_signals.h>`

Inheritance diagram for SignalIf::PseudoInstruction:

## Public Member Functions
| PseudoInstruction (SignalProgram *prog, SignalIf *block, SignalOpcode op)
| Normal constructor.
| PseudoInstruction (SignalProgram *prog, SignalOpcode op)
| Constructs an empty instruction of type `op`.
virtual void | Remove ()
| Removes the pseudo instruction.
virtual void | Evaluate (SignalVM &vm)
| Evaluate the pseudo instruction.
virtual void | SetNext (SignalInstruction *next_insn)
## Data Fields
SignalIf * | block
| The block to which this instruction belongs.

## Detailed Description

The If-Else and If-Endif pseudo instructions.

The Else instruction follows the Then block, and the Endif instruction follows the Else block.

These serve two purposes:

- They correctly vector the execution to after the if block (if needed).
- They provide an instruction for the GUI to insert other instructions before.

Definition at line 304 of file programmable_signals.h.

## Constructor & Destructor Documentation

SignalIf::PseudoInstruction::PseudoInstruction | ( | SignalProgram * | prog,
|  | SignalIf * | block,
|  | SignalOpcode | op |
| ) |  |  |

Normal constructor.

The pseudo instruction will be constructed as belonging to `block`.

Definition at line 241 of file programmable_signals.cpp.

References SignalIf::if_true, PSO_IF_ELSE, and PSO_IF_ENDIF.

SignalIf::PseudoInstruction::PseudoInstruction | ( | SignalProgram * | prog,
|  | SignalOpcode | op |
| ) |  |  |

Constructs an empty instruction of type `op`.

This should only be used by the saveload code during deserialization. The instruction must have its block field set correctly before the program is run.

Definition at line 237 of file programmable_signals.cpp.

## Member Function Documentation

void SignalIf::PseudoInstruction::Evaluate | ( | SignalVM & | vm | ) | `[virtual]`

Evaluate the pseudo instruction.

This involves vectoring execution to the instruction after the if.

Implements SignalInstruction.

Definition at line 263 of file programmable_signals.cpp.

References SignalIf::after, block, DEBUG, SignalVM::instruction, and PSO_IF_ELSE.

void SignalIf::PseudoInstruction::Remove | ( |  | ) | `[virtual]`

Removes the pseudo instruction.

Unless you are also removing the If it belongs to, this is nonsense and dangerous.

Implements SignalInstruction.

Definition at line 252 of file programmable_signals.cpp.

References block, SignalIf::if_false, SignalIf::if_true, PSO_IF_ELSE, and PSO_IF_ENDIF.

## Field Documentation

SignalIf* SignalIf::PseudoInstruction::block

The block to which this instruction belongs.

Definition at line 332 of file programmable_signals.h.

Referenced by Evaluate(), and Remove().

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

- src/programmable_signals.h
- src/programmable_signals.cpp