Next: 3.2.2.2 Example 2: prototyped
Up: 3.2.2 Meta Operator TypeSpecs
Previous: 3.2.2 Meta Operator TypeSpecs
As a first example, consider a matrix of reals given as an array of
arrays3.
In this case, the prototype consists of a common meta operator whose
value is MP_CopProtoArray
and whose number-of-arguments field
is non-zero. The common meta operator has a prototype annotation
specifying the type of each argument to the MP_CopProtoArray
operator. Notice again, that the number-of-arguments field of the
meta operator specifies the number of data values that appear at
data communication time and not the number of arguments that
follow the meta operator within the prototype tree. Figure
5 gives prototyped and non-prototyped versions
side-by-side for comparison.
Figure 5:
An array of even-lengths arrays
|
The top-level operator on line 1 specifies an array with 2 arguments.
The prototype annotation starting on line 2 specifies the
element type of the top-level array to be a 3 element array
(line 3).
So each element of the array from line 1 is another array.
The meta operator on line 3 also has a prototype (lines 4 - 5)
specifying that the elements of each subarray is an
IMP_Real32.
Note that the meta operator on line 3 does not have any actual
arguments within the prototype tree.
The number-of-arguments field specifies the number of arguments to
expect in the prototyped data tree that follows.
Next: 3.2.2.2 Example 2: prototyped
Up: 3.2.2 Meta Operator TypeSpecs
Previous: 3.2.2 Meta Operator TypeSpecs
| ZCA Home |
Reports |