next up previous top
Next: RPCCall
Up: Player Type
Previous: RoutineCall

RoutineDef

Semantics

The player type RoutineDef corresponds to an exported procedure or function (i.e., routine) definition in a component. It has a name and a signature. The name is the identifier used in the implementation, and the signature describes the types of the arguments and the return type that the routine has in the implementation. The function and procedure definitions are defined at the outer-most scope in a compilation unit and are made globally available from anywhere within the process boundary in which they are defined.

A RoutineDef player does not describe a definition or service that can be accessed by a remote process. It does describe a routine that can be called locally with a single process.

Component Types In

A player of type RoutineDef can legally be defined in components of the following types:

Role Type
Associations

A player of type RoutineDef can legally be associated with the following role types in connections of the specified type:

Properties

The following properties can be legally included in the property list of a RoutineDef player:

The syntax for the MaxAssocs property in a RoutineDef player is a single <integer> surrounded by parentheses:

MAXASSOCS (1)
The syntax for the MinAssocs property in a RoutineDef player is a single <integer> surrounded by parentheses:

MINASSOCS (1)
The syntax for the Signature property in a RoutineDef player consists of two fields, separated by a semicolon, surrounded by parentheses. Each of the fields is optional, yet one of them must be specified. The first field is a comma-separated list of items that are either <identifier>s or "string"s. The second field is a single <identifier> or "string". If the first field is omitted, the semicolon is required. If the second field is omitted, the semicolon must not be present:

SIGNATURE (int, "char *", double; "void")
SIGNATURE (int, "char *", double)
SIGNATURE (; "void")

Implementation Considerations

In the source code implementation, a RoutineDef player is implemented as a normal procedure or function definition in the syntax of the given programming language (in this case C). The function or procedure definition must be at the outer-most scope of the enclosing compilation unit. The following are example function definitions in C that implement RoutineDef players:

  /* assume that "pointer" is a global integer variable
    and that "stack" is a global character array */

  int stack_is_empty (void) {
      return (pointer == 0);
  }
void push (char *value) { stack[pointer++] = value; }

next up previous top
Next: RPCCall
Up: Player Type
Previous: RoutineCall

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996