Data Structures | Public Member Functions | Data Fields

# SignalIf Class Reference
[Programmable Signals.]

If signal instruction. More...

`#include <programmable_signals.h>`

Inheritance diagram for SignalIf:

## Data Structures
class | PseudoInstruction
| The If-Else and If-Endif pseudo instructions. More...
## Public Member Functions
| SignalIf (SignalProgram *prog, bool raw=false)
| Constructs an If instruction belonging to program `prog`.
void | SetCondition (SignalCondition *cond)
| Sets the instruction's condition, and releases the old condition.
virtual void | Evaluate (SignalVM &vm)
| Evaluates the If and takes the appropriate branch.
virtual void | Insert (SignalInstruction *before_insn)
virtual void | Remove ()
| Removes the If and all of its children.
virtual void | SetNext (SignalInstruction *next_insn)
## Data Fields
SignalCondition * | condition
| The if conditon.
SignalInstruction * | if_true
| The branch to take if true.
SignalInstruction * | if_false
| The branch to take if false.
SignalInstruction * | after
| The branch to take after the If.

## Detailed Description

If signal instruction.

This is perhaps the most important, as without it, programmable signals are pretty useless.

It's also the most complex!

Definition at line 290 of file programmable_signals.h.

## Constructor & Destructor Documentation

SignalIf::SignalIf | ( | SignalProgram * | prog,
|  | bool | raw = `false` |
| ) |  |  |

Constructs an If instruction belonging to program `prog`.

If `raw` is true, then the instruction is constructed raw (in order for the deserializer to be able to correctly deserialize the instruction).

Definition at line 278 of file programmable_signals.cpp.

References after, condition, if_false, if_true, PSC_ALWAYS, PSO_IF_ELSE, and PSO_IF_ENDIF.

## Member Function Documentation

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

Evaluates the If and takes the appropriate branch.

Implements SignalInstruction.

Definition at line 314 of file programmable_signals.cpp.

References condition, DEBUG, if_false, if_true, and SignalVM::instruction.

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

Removes the If and all of its children.

Implements SignalInstruction.

Definition at line 289 of file programmable_signals.cpp.

References after, condition, and if_true.

void SignalIf::SetCondition | ( | SignalCondition * | cond | ) |

Sets the instruction's condition, and releases the old condition.

Definition at line 307 of file programmable_signals.cpp.

References condition.

Referenced by CmdModifySignalInstruction().

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

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