|
CX Framework
Cross-platform C utility framework
|
Functions | |
| bool | ccbSignalEvent (stvlist *cvars, stvlist *args) |
| bool | ccbSignalSharedEvent (stvlist *cvars, stvlist *args) |
| bool | ccbAdvanceTask (stvlist *cvars, stvlist *args) |
Provides ready-to-use closure callback functions for common operations like event signaling and task management. These functions are designed to work with the closure and closure chain systems (see Closures and Closure Chains).
These callbacks are particularly useful for deferred execution, event handling, and coordination between asynchronous operations. Each callback expects specific captured variables (cvars) as documented.
Example usage with closure chains:
Advance a complex task
Closure callback that advances a ComplexTask given a weak reference. Acquires the task from the weak reference, advances it, then releases the task. If the weak reference is invalid (task destroyed), does nothing. Ignores call-time arguments.
This is useful for scheduling task advancement in response to events or callbacks.
Captured variables:
Weak(ComplexTask)* - Weak reference to the task to advance| cvars | Captured variables containing weak task reference |
| args | Call-time arguments (ignored) |
Signal an event
Closure callback that signals an Event. Expects the event pointer as the first captured variable (cvar). Ignores call-time arguments.
Captured variables:
Event* - Pointer to event to signal| cvars | Captured variables containing Event pointer |
| args | Call-time arguments (ignored) |
Signal and release a shared event
Closure callback that signals a SharedEvent and then releases the reference. Expects the shared event pointer as the first captured variable. Ignores call-time arguments.
This is useful for one-time event notifications where the shared event reference should be released after signaling.
Captured variables:
SharedEvent* - Pointer to shared event to signal and release| cvars | Captured variables containing SharedEvent pointer |
| args | Call-time arguments (ignored) |