scram::mef::Switch
Switch-Case conditional operations.
#include <conditional.h>
Inherits from scram::mef::ExpressionFormula< Switch >, scram::mef::Expression, boost::noncopyable
Public Classes
| Name | |
|---|---|
| struct | Case <br>Individual cases in the switch-case operation. |
Public Functions
| Name | |
|---|---|
| Switch(std::vector< Case > cases, Expression * default_value) | |
| virtual Interval | interval() override |
| template <typename F > <br>double | Compute(F && eval)<br>Computes the switch-case expression with the given evaluator. |
Additional inherited members
Public Functions inherited from scram::mef::ExpressionFormula< Switch >
| Name | |
|---|---|
| virtual double | value()<br>Computes the expression with argument expression default values. |
| Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments. |
Public Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments. | |
| virtual | ~Expression() =default |
| const std::vector< Expression * > & | args() const |
| virtual void | Validate() const<br>Validates the expression. |
| virtual double | value() =0 |
| virtual bool | IsDeviate()<br>Determines if the value of the expression contains deviate expressions. |
| double | Sample() |
| void | Reset()<br>This routine resets the sampling to get new values. |
Protected Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| void | AddArg(Expression * arg)<br>Registers an additional argument expression. |
Public Functions Documentation
function Switch
cpp
Switch(
std::vector< Case > cases,
Expression * default_value
)Parameters:
- cases The collection of cases to evaluate.
- default_value The default value if all cases are false.
function interval
cpp
virtual Interval interval() overrideReturn: The domain interval for validation purposes only.
Reimplements: scram::mef::Expression::interval
function Compute
cpp
template <typename F >
inline double Compute(
F && eval
)Computes the switch-case expression with the given evaluator.
Updated on 2025-11-11 at 16:51:08 +0000
