The special start and end pseudo instructions. More...
#include <programmable_signals.h>
Public Member Functions | |
SignalSpecial (SignalProgram *prog, SignalOpcode op) | |
Constructs a special signal of the opcode op in program prog . | |
virtual void | Evaluate (SignalVM &vm) |
Evaluates the instruction. | |
virtual void | Remove () |
Removes this instruction. | |
virtual void | SetNext (SignalInstruction *next_insn) |
Static Public Member Functions | |
static void | link (SignalSpecial *first, SignalSpecial *last) |
Links the first and last instructions in the program. | |
Data Fields | |
SignalInstruction * | next |
The next instruction after this one. |
The special start and end pseudo instructions.
These instructions serve two purposes:
Definition at line 241 of file programmable_signals.h.
SignalSpecial::SignalSpecial | ( | SignalProgram * | prog, | |
SignalOpcode | op | |||
) |
Constructs a special signal of the opcode op
in program prog
.
Generally you should not need to call this; it will be called by the program's constructor. An exception is in the saveload code, which needs to construct raw objects to deserialize into.
Definition at line 199 of file programmable_signals.cpp.
void SignalSpecial::Evaluate | ( | SignalVM & | vm | ) | [virtual] |
Evaluates the instruction.
If this is an Start instruction, flow will be vectored to the first instruction; if it is an End instruction, the program will terminate and the signal will be left red.
Implements SignalInstruction.
Definition at line 221 of file programmable_signals.cpp.
References DEBUG, SignalVM::instruction, next, and PSO_FIRST.
void SignalSpecial::link | ( | SignalSpecial * | first, | |
SignalSpecial * | last | |||
) | [static] |
Links the first and last instructions in the program.
Generally only to be called from the SignalProgram constructor.
Definition at line 214 of file programmable_signals.cpp.
void SignalSpecial::Remove | ( | ) | [virtual] |
Removes this instruction.
If this is the start instruction, then all of the other instructions in the program will be successively removed, (emptying it). If this is the End instruction, then it will do nothing.
This operation, unlike when executed on most instructions, does not destroy the instruction.
Implements SignalInstruction.
Definition at line 206 of file programmable_signals.cpp.
The next instruction after this one.
On the End instruction, this should be NULL.
Definition at line 279 of file programmable_signals.h.
Referenced by Evaluate(), link(), Remove(), and SignalSpecial().