To use the node in your project you should have the dinosalvioni/functionslibrary 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) {
Number count = getValue<output_OUT>(ctx);
if (isSettingUp()) //all'avvio imposto valore iniziale
count = getValue<input_INIT>(ctx);
if (isInputDirty<input_RST>(ctx)) //su reset imposto valore iniziale
count = getValue<input_INIT>(ctx);
else if (isInputDirty<input_INC>(ctx))
count += getValue<input_STEP>(ctx);
if (count > getValue<input_Max>(ctx)) {
count = getValue<input_Min>(ctx);
}
emitValue<output_OUT>(ctx, count);
emitValue<output_DONE>(ctx, true);
}