Chapter 6 Wrapped Class Reference
AttributeManager classes are likewise abstract base classes for any wrapped class that supports activities (see "Using Activities in ADL" on page 59) or attributes (see "Member Access" on page 45), and many applications can be written using the Pressed member rather than the underlying notification request classes Nro, MouseNro, and TimerNro. On the other hand, the services provided by these classes are fundamental. For example, every ADL program should use the 'Exit message provided by the MCapplication class. Detailed documentation for the these classes are provided in the following sections:
The class inheritance tree for the Activities and Application Services (AAS) of AM2 appears in Figure 6.1. Inheritance relationships are shown by the black lines that connect the boxes. Moving from the top to the bottom of the figure, classes inherit from those where a connection exists and they become more specific as you go down the tree. Classes with more that one connection to a superclass are said to have a multiple inheritance relationship
Exit the event loop and terminate the application after returning to the event loop and executing all queued asynchronous messages and propagating all constraints. This means that any statement after the method invocation in the calling method executes: 'Exit => theApp; Use the Die() built-in for emergency exits.on Sync
Normally attribute updates take effect, asynchronous messages are delivered, and constraints propagate when an activity callback returns control to the event loop. This method forces these actions to be taken immediately.on SetFatalErrors: list errorList
The mathematical built-ins recognize six named types of errors (see page 266). Two of these are fatal (DOMAIN, SING) and the other four (OVERFLOW, UNDERFLOW, TLOSS, PLOSS) are ignored by default. You can change this behavior by invoking this method on theApp. The single argument in the message should be a list of lists. Each sublist should be a pair consisting of a string specifying the name of an error type and a boolean constant (TRUE, FALSE) indicating whether or not the error is to be treated as fatal.on SetBypass: integer nEvents
Normally the AM2 event loop follows a strict priority model. High priority I/O events are always processed before timer events, which are processed before normal user interface events, which are processed before idle time events (work procedure callbacks). But this strict model can lock out the processing of user interface events indefinitely, say during a long stretch of software media decompression. This method inverts the event loop for the processing of one event every nEvents events. Normally, an inverted cycle of the event loop starts with checking for a user interface event, then a timer event, and finally a high priority I/O event. If the WorkProcBypass message has been sent to theApp with an argument of TRUE, however, then the inverted cycle will start with checking for an idle time notification request (work procedure) and will only go on to check for user interface events if none is found.on WorkProcBypass: boolean includeWorkProc
If the includeWorkProc is TRUE, then an inverted event cycle (see the previous method) includes checking for idle time notification. Otherwise, it does not. WorkProcBypass can be called repeatedly to toggle the value on and off.
Activity | Keys | Description |
---|---|---|
Tick | integer late, missed | periodic timer notification |
Idle | none | application idle |
Register for the activity specified in the Nro pointed to by hNro, making the object pointed to by hTarget the recipient of the future notification. This method returns a NULL handle if the subscription is refused, otherwise the value of hNro.on Unsubscribe: handle hNro, handle hTarget return handle
Unregister the subscription for the object pointed to by hTarget for the activity specified in the Nro pointed to by hNro. Return a NULL handle if the subscription could not be removed for any reason, otherwise the value of hNro.on TriggerNotification : string activityName, list valueList, handle hTarget
Trigger a notification for the activity activityName sent to the ADL object pointed to by hTarget. The notification message will have the selector activityName and three arguments:on IsAnyoneSubscribed : string activityName, handle hTarget return boolean1) the client data supplied in the subscribed Nro of type any;
2) a list of strings that supplies the keys for the activity, drawn from ActivityInfo member;
3) a list of values, valueList, that match the keys in 2.
The message Triggernotification is usually only sent if the programmer has defined a class with it's own, non-standard activities. See the example in section 3.4.2.
Check if the object pointed to by hTarget has subscribed for activity activityName. Return TRUE or FALSE.
Attribute | Type | Description | Access |
---|---|---|---|
ActivityInfo | List | This member is normally read-only, unless the user has subclassed ActivityManager to define his or her own activity. See the discussion in section 3.4.2. ActivityInfo is a specially formatted list of lists in which each sublist has the form { activityName, listOfActivityKeys }. | CG |
Table 4.12, "An Example Using the Movable Class," on page 77
Normally attributes are not updated until after an activity callback returns just before the next activity is dispatched for processing. The user can force updating of an object's attributes by sending a 'Commit to the object.
Create a notification request object for the specified activity that invokes method on the client with the argument clientData as the first argument of the callback message.upon CreateExtra: string activity, handle client, string method, any clientData, any extra
Same as the previous with the exception that it initializes the member Extra to the value extra.on HandleActivity: list keys, list values
Should not be called from the ADL, although it may be overwritten in a derived NRO class. This method is called as part of the notification sequence. keys contains the string names of the attributes pertaining to this notification, and values, contains the corresponding data in the same order.on Lookup: string key, list keys, list values return any
Lookup up key in the notification attribute-value pairs specified by keys and values and return the appropriate value. This method should become class common, when common is implemented.
Create a mouse notification request object for the specified activity that invokes method on the client with the argument clientData as the first argument of the callback message.on HandleActivity: list keys, list values
Should not be called from the ADL, although it may be overwritten in a derived NRO class. This method is called as part of the notification sequence. keys contains the string names of the attributes pertaining to this notification, and values, contains the corresponding data in the same order. For the list of attributes corresponding to mouse activities see "Basic Widget Activities" on page 127.
Create a notification request object for the Tick activity that invokes method on the client every ival milliseconds with the argument clientData as the first argument of the callback message.on HandleActivity: list keys, list values
Should not be called from the ADL, although it may be overwritten in a derived NRO class. This method is called as part of the notification sequence. keys contains the string names of the attributes pertaining to this notification, and values, contains the corresponding data in the same order.
Generated with Harlequin WebMaker