IfOperation

Description

A condition node. In the setup phase, the execution path is determined based on the return value of the handle function that is passed by the user to select opA or opB for delivery and execution.

Definition

1
2
3
4
5
6
7
struct IfCondParam {
    void *userData;
    bool (*handle)(void *userData);
    Operation *opA = nullptr;
    Operation *opB = nullptr;
    uint8_t rsv[32] = {0};
};

Parameters

Member

Type

Default Value

Description

userData

void *

-

Context pointer (user-defined data) passed to the callback.

handle

bool (*)(void*)

-

Callback for condition judgment. If true is returned, opA is selected. If false is returned, opB is selected.

opA

Operation *

nullptr

Branch operation executed when the condition is true.

opB

Operation *

nullptr

Branch operation executed when the condition is false.

Restrictions

The VariantPacks of opA and opB must be the same.