Inom
Hitta mer dokumentation
Supportresurser som ingår
| Ladda ner denna bok i PDF
The ToolTalk Enumerated Types
2
- This chapter provides reference information for the enumerated types component of the ToolTalk application programming interface (API).
- The ToolTalk enumerated types fall into these categories:
-
- Tt_address
- Tt_callback
- Tt_category
- Tt_class
- Tt_disposition
- Tt_filter
- Tt_mode
- Tt_scope
- Tt_state
- Tt_status
- They are listed in alphabetical order in each section.
Tt_address
-
Tt_address indicates which message attributes form the address to which the message will be delivered. Table 2-1 describes the possible values.
-
Table 2-1
| Value | Description |
| TT_HANDLER | Addressed to a specific handler that can perform this operation with these arguments. Fill in handler, op, and arg attributes of the message or pattern. |
| TT_OBJECT | Addressed to a specific object that performs this operation with these arguments. Fill in object, op, and arg attributes of the message or pattern. |
| TT_OTYPE | Addressed to the type of object that can perform this operation with these arguments. Fill in otype, op, and arg attributes of the message or pattern. |
| TT_PROCEDURE | Addressed to any process that can perform this operation with these arguments. Fill in the op and arg attributes of the message or pattern. |
Tt_callback
- These values are used to specify the action taken by the callback attached to messages or patterns. If no callback returns TT_CALLBACK_PROCESSED, tt_message_receive() will return the message. Table 2-2 describes the possible values.
-
Table 2-2
| Value | Description |
| TT_CALLBACK_CONTINUE | If the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run. |
| TT_CALLBACK_PROCESSED | If the callback returns
TT_CALLBACK_PROCESSED, no further callbacks will be invoked for this event, and the message will not be returned by tt_message_receive().
|
Tt_category
-
Tt_category values for the category attribute of a pattern indicate the receiver's intent. Table 2-3 describes the possible values.
-
Table 2-3
| Value | Description |
| TT_OBSERVE | Just looking at the message. No feedback will be given to the sender. |
| TT_HANDLE | Will process the message, including filling in return values if any. |
Tt_class
- These values for the class attribute of a message or pattern indicate whether the sender wants an action to take place after the message has been received. Table 2-4 describes the possible values.
-
Table 2-4
| Value | Description |
| TT_NOTICE | Notice of an event. Sender does not want feedback on this message. |
| TT_REQUEST | Request for some action to be taken. Sender must be notified of progress, success or failure, and must receive any return values. |
Tt_disposition
-
Tt_disposition values indicate whether the receiving application should be started to receive the message or if the message should be queued until the receiving process is started at a later time. The message can also be discarded if the receiver is not started.
- Note that Tt_disposition values can be added together, so that TT_QUEUE+TT_START means both to queue the message and to try to start a process. This can be useful if the start can fail (or be vetoed by the user), to ensure the message is processed as soon as an eligible process does start.
-
Table 2-5 describes the possible values.
-
Table 2-5
| Value | Description |
| TT_DISCARD = 0 | No receiver for this message. Message is returned to sender with the Tt_status field containing TT_FAILED. |
| TT_QUEUE = 1 | Queue the message until a process of the proper ptype receives the message. |
| TT_START = 2 | Attempt to start a process of the proper ptype if none is running. |
Tt_filter
-
Tt_filter_action is the return value from a query callback filter procedure. Table 2-6 describes the possible values.
-
Table 2-6
| Value | Description |
| TT_FILTER_CONTINUE | Continue the query, feed more values to the callback. |
| TT_FILTER_STOP | Stop the query, don't look for any more values. |
Tt_mode
-
Tt_mode values specify whether the sender, handler, or observers writes a message argument. Table 2-7 describes the possible values.
-
Table 2-7
| Value | Description |
| TT_IN | The argument is written by the sender and read by the handler
and any observers. |
| TT_OUT | The argument is written by the handler and read by the sender and any reply observers. |
| TT_INOUT | The argument is written by the sender and the handler and read by all. |
Tt_scope
-
Tt_scope values for the Scope attribute of a message or pattern indicate the set of processes eligible to receive the message. Table 2-8 describes the possible values.
-
Table 2-8
| Value | Description |
| TT_SESSION | All processes joined to the indicated session are eligible. |
| TT_FILE | All processes joined to the indicated file are eligible. |
| TT_BOTH | All processes joined to either the indicated file or the indicated session are eligible. |
| TT_FILE_IN_SESSION | All processes joined to both the indicated session and the indicated file are eligible. |
Tt_state
-
Tt_state values indicate a message's delivery status. Table 2-9 describes the possible values.
-
Table 2-9
| Value | Description |
| TT_CREATED | Message has been created but not yet sent.
(Only the sender of a message will see a message in this state.) |
| TT_SENT | Message has been sent but not yet handled. |
| TT_HANDLED | Message has been handled, return values are valid. |
| TT_FAILED | Message could not be delivered to a handler. |
| TT_QUEUED | Message has been queued for later delivery. |
| TT_STARTED | Attempting to start a process to handle the message. |
| TT_REJECTED | Message has been rejected by a possible handler. This state is seen only by the rejecting process. The ToolTalk service changes the state back to TT_SENT before delivering the message to another possible handler. If all possible handlers have rejected the message, the ToolTalk service changes the state to TT_FAILED before returning the message to the sender. |
Tt_status
- A Tt_status code is returned by all functions, sometimes directly and sometimes encoded in an error return value. See the ToolTalk User's Guide for instructions on to determine whether the Tt_status code is a warning or an error and for retrieving the error message string for a Tt_status code.
-
Chapter 7, "ToolTalk Error Messages," lists the Tt_status codes. The following information is provided for each status code:
-
- Message id
- Error message string
- Description
- Solution
|
|