Reference

The Reference accessor (class ) is used to reference an attribute of one of the prototype nodes (also called sub-attributes) at the prototype level. When the corresponding attribute is changed, the new value is forwarded to the specified sub-accessor. Conversely, when the attribute is queried, it is first queried from the node and forwarded to the prototype. A Reference accessor is similar to a reference (a pointer or an alias) in a programming language.

Parameters

  • Accessor: Node attribute or prototype value that holds the value. The type of the value is determined by what the accessor points to.

Example

The steps attribute in the thermo prototype of the samples library points directly to the steps attribute of the scale object. When the attribute steps is set, it is assigned to the scale.step attribute. If the scale.step attribute is changed by the program, any query of the attribute returns the new value.