Class: InstrumentBackplane
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
Create an InstrumentBackplane
Returns
Defined in
src/sdk/instruments/Backplane.ts:39
Methods
addInstrument
▸ addInstrument(name
, instrument
, override?
): void
Add an instrument to this backplane.
Parameters
Name | 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
Defined in
src/sdk/instruments/Backplane.ts:90
addPublisher
▸ addPublisher(name
, publisher
, override?
): void
Add a publisher to this backplane.
Parameters
Name | 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
Defined in
src/sdk/instruments/Backplane.ts:75
getInstrument
▸ getInstrument<T
>(name
): undefined
| T
Gets an instrument from this backplane.
Type parameters
Name | Type |
---|---|
T | extends Instrument = Instrument |
Parameters
Name | 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.
Defined in
src/sdk/instruments/Backplane.ts:110
getPublisher
▸ getPublisher<T
>(name
): undefined
| T
Gets a publisher from this backplane.
Type parameters
Name | Type |
---|---|
T | extends BackplanePublisher = BackplanePublisher |
Parameters
Name | 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.
Defined in
src/sdk/instruments/Backplane.ts:101
init
▸ init(): void
Initialize all the things. This is initially just a proxy for the private initPublishers() and initInstruments() methods.
This should be simplified.
Returns
void
Defined in
src/sdk/instruments/Backplane.ts:50
onUpdate
▸ onUpdate(): void
Update all the things. This is initially just a proxy for the private updatePublishers() and updateInstruments() methods.
This should be simplified.
Returns
void
Defined in
src/sdk/instruments/Backplane.ts:61