/** * <summary> * Registers the callback function that is invoked on every change of advertised value. * <para> * The callback is invoked only during the execution of <c>ySleep</c> or <c>yHandleEvents</c>. * This provides control over the time when the callback is triggered. For good responsiveness, remember to call * one of these two functions periodically. To unregister a callback, pass a null pointer as argument. * </para> * <para> * </para> * </summary> * <param name="callback"> * the callback function to call, or a null pointer. The callback function should take two * arguments: the function object of which the value has changed, and the character string describing * the new advertised value. * @noreturn * </param> */ public void registerValueCallback(GenericUpdateCallback callback) { if (callback != null) { _registerFuncCallback(this); } else { _unregisterFuncCallback(this); } _genCallback = new GenericUpdateCallback(callback); }
public YFunction(string classname, string func) { _className = classname; _func = func; _lastErrorType = YAPI.SUCCESS; _lastErrorMsg = ""; _cacheExpiration = 0; _fundescr = FUNCTIONDESCRIPTOR_INVALID; _userData = null; _genCallback = null; _FunctionCache.Add(this); }