sys::Obj sys::Virtual sys::Watch
public abstract class Watch
Watch is used to manage an event queue of component changes. Every component is allocated a byte per potential watch determined by the Watch.max define. To use the watch framework:
- Create your own subclass of Watch - In your service create an array of your Watch subclass - Call App.initWatches() on service startup with your subclass array - To allocate a watch call App.openWatch() passing in the array of your subclasses - When you close a watch, make sure you call App.closeWatch()
public bool closed
Is this watch open or closed
public static const define int eventAll
Watch bitmask for all change event bits
public static const define int eventConfig
Watch bitmask indicating a pending config property change event
public static const define int eventLinks
Watch bitmask indicating a pending link change event
public static const define int eventRuntime
Watch bitmask indicating a pending runtime property change event
public static const define int eventTree
Watch bitmask indicating a pending tree change event
public byte index
Bottom byte of the id is the index into App.watches
public static const define int max
Number of concurrent watches to support
public byte rand
The top byte of the id is randomized to prevent id collisions
public static const define int subAll
Watch bitmask for all subscription bits
public static const define int subConfig
Watch bitmask indicating a subscription to config property changes
public static const define int subLinks
Watch bitmask indicating a subscription to link changes
public static const define int subRuntime
Watch bitmask indicating a subscription to runtime property changes
public static const define int subTree
Watch bitmask indicating a subscription to tree changes
public static int fromSubBit(int subBit)
Map a subscription bit to its ASCII code.
public int id()
The watch id is a combination of the count in the high byte and the index in the low byte.
public static int toEventBit(int what)
Map ASCII codes to event bit:
't' = eventTree 'c' = eventConfig 'r' = eventRuntime 'l' = eventLink '*' = eventAll
public static int toSubBit(int what)
Map ASCII codes to subscription bit:
't' = subTree 'c' = subConfig 'r' = subRuntime 'l' = subLink '*' = subAll