ToolTalk Reference Manual
  Sök endast i den här boken
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
ValueDescription
TT_HANDLERAddressed 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_OBJECTAddressed to a specific object that performs this operation with these arguments. Fill in object, op, and arg attributes of the message or pattern.
TT_OTYPEAddressed 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_PROCEDUREAddressed 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
ValueDescription
TT_CALLBACK_CONTINUEIf the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run.
TT_CALLBACK_PROCESSEDIf 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
ValueDescription
TT_OBSERVEJust looking at the message. No feedback will be given to the sender.
TT_HANDLEWill 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
ValueDescription
TT_NOTICENotice of an event. Sender does not want feedback on this message.
TT_REQUESTRequest 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
ValueDescription
TT_DISCARD = 0No receiver for this message. Message is returned to sender with the Tt_status field containing TT_FAILED.
TT_QUEUE = 1Queue the message until a process of the proper ptype receives the message.
TT_START = 2Attempt 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
ValueDescription
TT_FILTER_CONTINUEContinue the query, feed more values to the callback.
TT_FILTER_STOPStop 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
ValueDescription
TT_INThe argument is written by the sender and read by the handler
and any observers.
TT_OUTThe argument is written by the handler and read by the sender and any reply observers.
TT_INOUTThe 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
ValueDescription
TT_SESSIONAll processes joined to the indicated session are eligible.
TT_FILEAll processes joined to the indicated file are eligible.
TT_BOTHAll processes joined to either the indicated file or the indicated session are eligible.
TT_FILE_IN_SESSIONAll 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
ValueDescription
TT_CREATEDMessage has been created but not yet sent.
(Only the sender of a message will see a message in this state.)
TT_SENTMessage has been sent but not yet handled.
TT_HANDLEDMessage has been handled, return values are valid.
TT_FAILEDMessage could not be delivered to a handler.
TT_QUEUEDMessage has been queued for later delivery.
TT_STARTEDAttempting to start a process to handle the message.
TT_REJECTEDMessage 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