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
Parameter | Type | Default value | Description |
---|---|---|---|
name | string | undefined | A symbolic name for the instrument for reference. |
instrument | Instrument | undefined | The instrument to add. |
override | boolean | false | Whether 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
Parameter | Type | Default value | Description |
---|---|---|---|
name | string | undefined | A symbolic name for the publisher for reference. |
publisher | BackplanePublisher | undefined | The publisher to add. |
override | boolean | false | Whether 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 Parameter | Default type |
---|---|
T extends Instrument | Instrument |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The 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 Parameter | Default type |
---|---|
T extends BackplanePublisher | BackplanePublisher |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The 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