Skip to main content

Class: InstrumentBackplane

Defined in: src/sdk/instruments/Backplane.ts:28

InstrumentBackplane provides a common control point for aggregating and managing any number of publishers. This can be used as an "update loop" corral", amongst other things.

Constructors

Constructor

new InstrumentBackplane(): InstrumentBackplane

Defined in: src/sdk/instruments/Backplane.ts:39

Create an InstrumentBackplane

Returns

InstrumentBackplane

Methods

addInstrument()

addInstrument(name, instrument, override): void

Defined in: src/sdk/instruments/Backplane.ts:90

Add an instrument to this backplane.

Parameters

ParameterTypeDefault valueDescription
namestringundefinedA symbolic name for the instrument for reference.
instrumentInstrumentundefinedThe instrument to add.
overridebooleanfalseWhether to override any existing instruments added to this backplane under the same name. If true, any existing instrument with the same name will removed from this backplane and the new one added in its place. If false, the new instrument will not be added if this backplane already has an instrument with the same name or an instrument of the same type. Defaults to false.

Returns

void


addPublisher()

addPublisher(name, publisher, override): void

Defined in: src/sdk/instruments/Backplane.ts:75

Add a publisher to this backplane.

Parameters

ParameterTypeDefault valueDescription
namestringundefinedA symbolic name for the publisher for reference.
publisherBackplanePublisherundefinedThe publisher to add.
overridebooleanfalseWhether to override any existing publishers added to this backplane under the same name. If true, any existing publisher with the same name will removed from this backplane and the new one added in its place. If false, the new publisher will not be added if this backplane already has a publisher with the same name or a publisher of the same type. Defaults to false.

Returns

void


getInstrument()

getInstrument<T>(name): undefined | T

Defined in: src/sdk/instruments/Backplane.ts:110

Gets an instrument from this backplane.

Type Parameters

Type ParameterDefault type
T extends InstrumentInstrument

Parameters

ParameterTypeDescription
namestringThe name of the instrument to get.

Returns

undefined | T

The instrument in this backplane with the specified name, or undefined if there is no such instrument.


getPublisher()

getPublisher<T>(name): undefined | T

Defined in: src/sdk/instruments/Backplane.ts:101

Gets a publisher from this backplane.

Type Parameters

Type ParameterDefault type
T extends BackplanePublisherBackplanePublisher

Parameters

ParameterTypeDescription
namestringThe name of the publisher to get.

Returns

undefined | T

The publisher in this backplane with the specified name, or undefined if there is no such publisher.


init()

init(): void

Defined in: src/sdk/instruments/Backplane.ts:50

Initialize all the things. This is initially just a proxy for the private initPublishers() and initInstruments() methods.

This should be simplified.

Returns

void


onUpdate()

onUpdate(): void

Defined in: src/sdk/instruments/Backplane.ts:61

Update all the things. This is initially just a proxy for the private updatePublishers() and updateInstruments() methods.

This should be simplified.

Returns

void