7.3. Selectors

In the runtime library, a selector is identifyable by a string which is called the selector's name. This name consists of the name parts and an abbreviated form of the argument and return types. The abbreviated type names are:

Table 7-2. Selector type encodings

chartype
vvoid
oboolean
bbyte
cchar
iint
llong
ffloat
ddouble
ppointer
sselector
robject reference
xdynamic

The following table shows examples: for several method declarations the name of the corresponding selector.

[Grammar desired.]

Table 7-3. Example selector name encodings

methodselector
int value;"(i)value"
void setValue float d;"(v)setValue(d)"
(Foo) bar (int, double) (a, b) with: int c = 0;"(r)bar(id)with:(i)"

[Actually, this is the future syntax. Currently, it is ambiguous, hence replaceable.]

In C, a selector is defined by a struct; The struct selector is the direct implementation of the TOM selectors.


typedef struct selector
{
  unsigned int sel_id;

  struct name name;

  struct trt_selector_args *in, *out;
} *selector;

sel_id

This is the unique identity of a selector. All selectors have such an identity in the closed enumeration of all selectors. Every two selectors with identical name, argument types and return types have the same identity. If no dynamic loading has taken place, the following is true for any two selectors a and b:

[Actually, it isn't any longer.]


a->sel_id == b->sel_id <-> a == b.
name

the name of the selector. This has two fields: s being the zero terminated string, and len being its length.

in, out

the selector argument descriptions for the arguments to (in) and return value from (out) methods denoted by this selector.