inout

failsafe/upown/inout

No description
inout
@/inout
UPnumber
DOWNnumber
inout
UP
DOWN
OUTVAL
OUTVALnumber
To use the node in your project you should have the failsafe/upown library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto inValue = getValue<input_UP>(ctx);
    auto inValue = getValue<input_DOWN>(ctx);
    
        Number count = getValue<output_OUT>(ctx);

    if (isInputDirty<input_UP>(ctx))
        count += 1;
    else if (isInputDirty<input_DOWN>(ctx))
        count -= 1;
    
    emitValue<output_OUT>(ctx, count);
}