Recent Changes - Search:

edit SideBar

Implement

An accessor may specify that it implements an interface or the interface of another accessor in its setup() function by invoking:

  • implement(<string> name): Implement an interface with the specified name.

This has the effect of executing the setup() function of the specified interface or accessor, so any inputs, outputs, and parameters defined by the specified interface or accessor will also be inputs, outputs, and parameters of this accessor.

For example, suppose an interface MyInterface has the following:

  exports.setup = function() {
    this.parameter('foo', {'value':42});
    this.output('bar');
  }

Then if an accessor specifies the following:

  exports.setup = function() {
    this.implement('MyInterface');
  }

then it will also have a parameter named 'foo' and an output named 'bar'. A derived accessor may modify the options of the interface specification. For example,

  exports.setup = function() {
    this.implement('MyInterface');
    this.parameter('foo', {'value':43});
  }

modifies the default value of 'foo' to 43.

See Also


Back to accessor specification

Edit - History - Print - Recent Changes - Search
Page last modified on September 14, 2017, at 10:07 AM