Content-type: text/html
typedef int (*RTPredicate_fp)(RTRegister *regp);
RTConditionedObserver *RTConditionedObserver_Constructor( char *register_name, RTClockMicroSecs usec_response , RTEvent_fp assert_make_efp, RTEvent_fp assert_break_efp, RTPredicate_fp make_pred_pfp, RTPredicate_fp break_pred_pfp, RTClockMicroSecs make_pred_delay, RTClockMicroSecs break_pred_delay, void *event_arg);
const char *RTConditionedObserver_RegisterName(RTConditionedObserver *cond_obp);
void RTConditionedObserver_Free(RTConditionedObserver *cond_obp);
RTConditionedObserver creates an opaque object that observes the register named register_name. The arguments supply two boolean predicates, make_pred_pfp and break_pred_pfp which are called with the register pointer and return non-zero if the respective predicate is asserted true. The constructor create two RTReactiveTasks, one to activate the "make" event, assert_make_efp and on to activate the "break" event, assert_break_efp with a response time given by usec_response. These two RTReactiveTasks bind the event argument to the passed parameter event_arg, which may optionally be an RTRefCnt_Object reference. The RTEvent this argument will always be the RTConditionedObserver reference. The "debounce" time required from when a predicate is asserted to when the RTReactiveTask is activated is controlled for the "make" predicate and the "break" predicate by the parameters make_pred_delay and break_pred_delay. The sum of these two delays bounds the maximum frequency of RTReactiveTask activation. By varying the delays, a variety of latency regimens, including so-called "edge-triggered", may be affected as may be required. RTConditionedObserver_RegisterName is a convenience function that returns the name of the register associated with the RTConditionedObserver. RTConditionedObserver_Free ends the lifecycle and releases the resources associated with the RTConditionedObserver. Although designed for bi-modal operation, the infrastructure could be used to effect multi-modal rate-limited behavior.
RTConditionedObserver is a Chronolytix Layer 1 function.
RTEvent(Chronolytix),
RTReactiveTask(Chronolytix),
RTRefCnt_Object(Chronolytix),