scram::mef::IfThenElse
Conditional application of instructions.
#include <instruction.h>
Inherits from scram::mef::Visitable< IfThenElse >, scram::mef::Instruction, boost::noncopyable
Public Functions
| Name | |
|---|---|
| IfThenElse(Expression * expression, Instruction * then_instruction, Instruction * else_instruction =nullptr) | |
| Expression * | expression() const |
| Instruction * | then_instruction() const |
| Instruction * | else_instruction() const |
Additional inherited members
Public Functions inherited from scram::mef::Visitable< IfThenElse >
| Name | |
|---|---|
| virtual void | Accept(InstructionVisitor * visitor) const<br>Calls visit with the object pointer T*. |
Public Functions inherited from scram::mef::Instruction
| Name | |
|---|---|
| virtual | ~Instruction() =default |
| virtual void | Accept(InstructionVisitor * visitor) const =0<br>Applies the visitor to the object. |
Public Functions Documentation
function IfThenElse
cpp
inline IfThenElse(
Expression * expression,
Instruction * then_instruction,
Instruction * else_instruction =nullptr
)Parameters:
- expression The expression to evaluate for truth.
- then_instruction The required instruction to execute.
- else_instruction An optional instruction for the false case.
function expression
cpp
inline Expression * expression() constReturn: The conditional expression of the ternary instruction.
function then_instruction
cpp
inline Instruction * then_instruction() constReturn: The instruction to execute if the expression is true.
function else_instruction
cpp
inline Instruction * else_instruction() constReturn: The instruction to execute if the expression is false. nullptr if the else instruction is optional and not set.
Updated on 2025-11-11 at 16:51:08 +0000
