@hla4ts/hla-api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,874 @@
1
+ /**
2
+ * Federate Ambassador Interface
3
+ *
4
+ * This module defines the FederateAmbassador interface that users implement
5
+ * to receive callbacks from the RTI.
6
+ *
7
+ * The callbacks are grouped by service category according to the HLA specification.
8
+ */
9
+
10
+ import type {
11
+ FederateHandle,
12
+ ObjectClassHandle,
13
+ AttributeHandle,
14
+ InteractionClassHandle,
15
+ ObjectInstanceHandle,
16
+ AttributeHandleSet,
17
+ AttributeHandleValueMap,
18
+ ParameterHandleValueMap,
19
+ TransportationTypeHandle,
20
+ LogicalTime,
21
+ MessageRetractionHandle,
22
+ UserSuppliedTag,
23
+ FederationExecutionInformationSet,
24
+ FederationExecutionMemberInformationSet,
25
+ FederateHandleSaveStatusPairArray,
26
+ FederateRestoreStatusArray,
27
+ ConveyedRegionSet,
28
+ OrderType,
29
+ SynchronizationPointFailureReason,
30
+ SaveFailureReason,
31
+ RestoreFailureReason,
32
+ } from "./types.ts";
33
+
34
+ /**
35
+ * FederateAmbassador interface.
36
+ *
37
+ * Implement this interface to receive callbacks from the RTI.
38
+ * All methods are optional - implement only the callbacks your federate needs.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const myFederateAmbassador: FederateAmbassador = {
43
+ * discoverObjectInstance(objectInstance, objectClass, objectInstanceName) {
44
+ * console.log(`Discovered object: ${objectInstanceName}`);
45
+ * },
46
+ *
47
+ * reflectAttributeValues(objectInstance, attributeValues, tag) {
48
+ * console.log(`Received update for object`);
49
+ * },
50
+ *
51
+ * receiveInteraction(interactionClass, parameterValues, tag) {
52
+ * console.log(`Received interaction`);
53
+ * },
54
+ * };
55
+ * ```
56
+ */
57
+ export interface FederateAmbassador {
58
+ // ===========================================================================
59
+ // Connection Management
60
+ // ===========================================================================
61
+
62
+ /**
63
+ * Called when the connection to the RTI is lost.
64
+ *
65
+ * @param faultDescription - Description of why the connection was lost
66
+ */
67
+ connectionLost?(faultDescription: string): void;
68
+
69
+ // ===========================================================================
70
+ // Federation Management
71
+ // ===========================================================================
72
+
73
+ /**
74
+ * Reports the list of federation executions (async response to listFederationExecutions).
75
+ *
76
+ * @param federations - Information about available federations
77
+ */
78
+ reportFederationExecutions?(federations: FederationExecutionInformationSet): void;
79
+
80
+ /**
81
+ * Reports the list of members in a federation (async response to listFederationExecutionMembers).
82
+ *
83
+ * @param federationName - Name of the federation
84
+ * @param members - Information about federation members
85
+ */
86
+ reportFederationExecutionMembers?(
87
+ federationName: string,
88
+ members: FederationExecutionMemberInformationSet
89
+ ): void;
90
+
91
+ /**
92
+ * Reports that the requested federation does not exist.
93
+ *
94
+ * @param federationName - Name of the federation that doesn't exist
95
+ */
96
+ reportFederationExecutionDoesNotExist?(federationName: string): void;
97
+
98
+ /**
99
+ * Called when another federate resigns from the federation.
100
+ *
101
+ * @param reasonForResignDescription - Description of why the federate resigned
102
+ */
103
+ federateResigned?(reasonForResignDescription: string): void;
104
+
105
+ // ===========================================================================
106
+ // Synchronization Point Services
107
+ // ===========================================================================
108
+
109
+ /**
110
+ * Called when a synchronization point registration succeeds.
111
+ *
112
+ * @param label - The synchronization point label
113
+ */
114
+ synchronizationPointRegistrationSucceeded?(label: string): void;
115
+
116
+ /**
117
+ * Called when a synchronization point registration fails.
118
+ *
119
+ * @param label - The synchronization point label
120
+ * @param reason - Why the registration failed
121
+ */
122
+ synchronizationPointRegistrationFailed?(
123
+ label: string,
124
+ reason: SynchronizationPointFailureReason
125
+ ): void;
126
+
127
+ /**
128
+ * Called when a synchronization point is announced.
129
+ *
130
+ * @param label - The synchronization point label
131
+ * @param userSuppliedTag - User-supplied tag from the registering federate
132
+ */
133
+ announceSynchronizationPoint?(label: string, userSuppliedTag: UserSuppliedTag): void;
134
+
135
+ /**
136
+ * Called when all federates have achieved a synchronization point.
137
+ *
138
+ * @param label - The synchronization point label
139
+ * @param failedToSyncSet - Set of federates that failed to synchronize (may be empty)
140
+ */
141
+ federationSynchronized?(label: string, failedToSyncSet: FederateHandle[]): void;
142
+
143
+ // ===========================================================================
144
+ // Save Services
145
+ // ===========================================================================
146
+
147
+ /**
148
+ * Called to initiate a federate save.
149
+ *
150
+ * @param label - The save label
151
+ */
152
+ initiateFederateSave?(label: string): void;
153
+
154
+ /**
155
+ * Called to initiate a federate save at a specific time.
156
+ *
157
+ * @param label - The save label
158
+ * @param time - The logical time for the save
159
+ */
160
+ initiateFederateSaveWithTime?(label: string, time: LogicalTime): void;
161
+
162
+ /**
163
+ * Called when the federation has been saved.
164
+ */
165
+ federationSaved?(): void;
166
+
167
+ /**
168
+ * Called when the federation save failed.
169
+ *
170
+ * @param reason - Why the save failed
171
+ */
172
+ federationNotSaved?(reason: SaveFailureReason): void;
173
+
174
+ /**
175
+ * Response to queryFederationSaveStatus.
176
+ *
177
+ * @param saveStatusPairs - Status of each federate's save
178
+ */
179
+ federationSaveStatusResponse?(saveStatusPairs: FederateHandleSaveStatusPairArray): void;
180
+
181
+ // ===========================================================================
182
+ // Restore Services
183
+ // ===========================================================================
184
+
185
+ /**
186
+ * Called when a federation restore request succeeds.
187
+ *
188
+ * @param label - The restore label
189
+ */
190
+ requestFederationRestoreSucceeded?(label: string): void;
191
+
192
+ /**
193
+ * Called when a federation restore request fails.
194
+ *
195
+ * @param label - The restore label
196
+ */
197
+ requestFederationRestoreFailed?(label: string): void;
198
+
199
+ /**
200
+ * Called when a federation restore has begun.
201
+ */
202
+ federationRestoreBegun?(): void;
203
+
204
+ /**
205
+ * Called to initiate a federate restore.
206
+ *
207
+ * @param label - The restore label
208
+ * @param federateName - Name to restore as
209
+ * @param postRestoreFederateHandle - Handle after restore
210
+ */
211
+ initiateFederateRestore?(
212
+ label: string,
213
+ federateName: string,
214
+ postRestoreFederateHandle: FederateHandle
215
+ ): void;
216
+
217
+ /**
218
+ * Called when the federation has been restored.
219
+ */
220
+ federationRestored?(): void;
221
+
222
+ /**
223
+ * Called when the federation restore failed.
224
+ *
225
+ * @param reason - Why the restore failed
226
+ */
227
+ federationNotRestored?(reason: RestoreFailureReason): void;
228
+
229
+ /**
230
+ * Response to queryFederationRestoreStatus.
231
+ *
232
+ * @param restoreStatuses - Status of each federate's restore
233
+ */
234
+ federationRestoreStatusResponse?(restoreStatuses: FederateRestoreStatusArray): void;
235
+
236
+ // ===========================================================================
237
+ // Declaration Management
238
+ // ===========================================================================
239
+
240
+ /**
241
+ * Called when another federate subscribes to an object class this federate publishes.
242
+ *
243
+ * @param objectClass - The object class handle
244
+ */
245
+ startRegistrationForObjectClass?(objectClass: ObjectClassHandle): void;
246
+
247
+ /**
248
+ * Called when no federates are subscribed to an object class this federate publishes.
249
+ *
250
+ * @param objectClass - The object class handle
251
+ */
252
+ stopRegistrationForObjectClass?(objectClass: ObjectClassHandle): void;
253
+
254
+ /**
255
+ * Called when another federate subscribes to an interaction class this federate publishes.
256
+ *
257
+ * @param interactionClass - The interaction class handle
258
+ */
259
+ turnInteractionsOn?(interactionClass: InteractionClassHandle): void;
260
+
261
+ /**
262
+ * Called when no federates are subscribed to an interaction class this federate publishes.
263
+ *
264
+ * @param interactionClass - The interaction class handle
265
+ */
266
+ turnInteractionsOff?(interactionClass: InteractionClassHandle): void;
267
+
268
+ // ===========================================================================
269
+ // Object Instance Name Reservation
270
+ // ===========================================================================
271
+
272
+ /**
273
+ * Called when an object instance name reservation succeeds.
274
+ *
275
+ * @param objectInstanceName - The reserved name
276
+ */
277
+ objectInstanceNameReservationSucceeded?(objectInstanceName: string): void;
278
+
279
+ /**
280
+ * Called when an object instance name reservation fails.
281
+ *
282
+ * @param objectInstanceName - The name that could not be reserved
283
+ */
284
+ objectInstanceNameReservationFailed?(objectInstanceName: string): void;
285
+
286
+ /**
287
+ * Called when multiple object instance name reservations succeed.
288
+ *
289
+ * @param objectInstanceNames - The reserved names
290
+ */
291
+ multipleObjectInstanceNameReservationSucceeded?(objectInstanceNames: string[]): void;
292
+
293
+ /**
294
+ * Called when multiple object instance name reservations fail.
295
+ *
296
+ * @param objectInstanceNames - The names that could not be reserved
297
+ */
298
+ multipleObjectInstanceNameReservationFailed?(objectInstanceNames: string[]): void;
299
+
300
+ // ===========================================================================
301
+ // Object Management - Discovery & Removal
302
+ // ===========================================================================
303
+
304
+ /**
305
+ * Called when a new object instance is discovered.
306
+ *
307
+ * @param objectInstance - Handle of the discovered object
308
+ * @param objectClass - Handle of the object's class
309
+ * @param objectInstanceName - Name of the object instance
310
+ * @param producingFederate - Handle of the federate that registered the object
311
+ */
312
+ discoverObjectInstance?(
313
+ objectInstance: ObjectInstanceHandle,
314
+ objectClass: ObjectClassHandle,
315
+ objectInstanceName: string,
316
+ producingFederate: FederateHandle
317
+ ): void;
318
+
319
+ /**
320
+ * Called when an object instance is removed (deleted) without time.
321
+ *
322
+ * @param objectInstance - Handle of the removed object
323
+ * @param userSuppliedTag - User-supplied tag
324
+ * @param producingFederate - Handle of the federate that deleted the object
325
+ */
326
+ removeObjectInstance?(
327
+ objectInstance: ObjectInstanceHandle,
328
+ userSuppliedTag: UserSuppliedTag,
329
+ producingFederate: FederateHandle
330
+ ): void;
331
+
332
+ /**
333
+ * Called when an object instance is removed (deleted) with time.
334
+ *
335
+ * @param objectInstance - Handle of the removed object
336
+ * @param userSuppliedTag - User-supplied tag
337
+ * @param producingFederate - Handle of the federate that deleted the object
338
+ * @param time - Logical time of deletion
339
+ * @param sentOrderType - Order type used by sender
340
+ * @param receivedOrderType - Order type as received
341
+ * @param retractionHandle - Handle for potential retraction (optional)
342
+ */
343
+ removeObjectInstanceWithTime?(
344
+ objectInstance: ObjectInstanceHandle,
345
+ userSuppliedTag: UserSuppliedTag,
346
+ producingFederate: FederateHandle,
347
+ time: LogicalTime,
348
+ sentOrderType: OrderType,
349
+ receivedOrderType: OrderType,
350
+ retractionHandle?: MessageRetractionHandle
351
+ ): void;
352
+
353
+ // ===========================================================================
354
+ // Object Management - Attribute Updates
355
+ // ===========================================================================
356
+
357
+ /**
358
+ * Called when attribute values are reflected (updated) without time.
359
+ *
360
+ * @param objectInstance - Handle of the object
361
+ * @param attributeValues - Map of attribute handles to values
362
+ * @param userSuppliedTag - User-supplied tag
363
+ * @param transportationType - Transportation type used
364
+ * @param producingFederate - Handle of the updating federate
365
+ * @param sentRegions - Regions used by sender (optional, for DDM)
366
+ */
367
+ reflectAttributeValues?(
368
+ objectInstance: ObjectInstanceHandle,
369
+ attributeValues: AttributeHandleValueMap,
370
+ userSuppliedTag: UserSuppliedTag,
371
+ transportationType: TransportationTypeHandle,
372
+ producingFederate: FederateHandle,
373
+ sentRegions?: ConveyedRegionSet
374
+ ): void;
375
+
376
+ /**
377
+ * Called when attribute values are reflected (updated) with time.
378
+ *
379
+ * @param objectInstance - Handle of the object
380
+ * @param attributeValues - Map of attribute handles to values
381
+ * @param userSuppliedTag - User-supplied tag
382
+ * @param transportationType - Transportation type used
383
+ * @param producingFederate - Handle of the updating federate
384
+ * @param sentRegions - Regions used by sender (optional, for DDM)
385
+ * @param time - Logical time of update
386
+ * @param sentOrderType - Order type used by sender
387
+ * @param receivedOrderType - Order type as received
388
+ * @param retractionHandle - Handle for potential retraction (optional)
389
+ */
390
+ reflectAttributeValuesWithTime?(
391
+ objectInstance: ObjectInstanceHandle,
392
+ attributeValues: AttributeHandleValueMap,
393
+ userSuppliedTag: UserSuppliedTag,
394
+ transportationType: TransportationTypeHandle,
395
+ producingFederate: FederateHandle,
396
+ sentRegions: ConveyedRegionSet | undefined,
397
+ time: LogicalTime,
398
+ sentOrderType: OrderType,
399
+ receivedOrderType: OrderType,
400
+ retractionHandle?: MessageRetractionHandle
401
+ ): void;
402
+
403
+ // ===========================================================================
404
+ // Object Management - Interactions
405
+ // ===========================================================================
406
+
407
+ /**
408
+ * Called when an interaction is received without time.
409
+ *
410
+ * @param interactionClass - Handle of the interaction class
411
+ * @param parameterValues - Map of parameter handles to values
412
+ * @param userSuppliedTag - User-supplied tag
413
+ * @param transportationType - Transportation type used
414
+ * @param producingFederate - Handle of the sending federate
415
+ * @param sentRegions - Regions used by sender (optional, for DDM)
416
+ */
417
+ receiveInteraction?(
418
+ interactionClass: InteractionClassHandle,
419
+ parameterValues: ParameterHandleValueMap,
420
+ userSuppliedTag: UserSuppliedTag,
421
+ transportationType: TransportationTypeHandle,
422
+ producingFederate: FederateHandle,
423
+ sentRegions?: ConveyedRegionSet
424
+ ): void;
425
+
426
+ /**
427
+ * Called when an interaction is received with time.
428
+ *
429
+ * @param interactionClass - Handle of the interaction class
430
+ * @param parameterValues - Map of parameter handles to values
431
+ * @param userSuppliedTag - User-supplied tag
432
+ * @param transportationType - Transportation type used
433
+ * @param producingFederate - Handle of the sending federate
434
+ * @param sentRegions - Regions used by sender (optional, for DDM)
435
+ * @param time - Logical time of interaction
436
+ * @param sentOrderType - Order type used by sender
437
+ * @param receivedOrderType - Order type as received
438
+ * @param retractionHandle - Handle for potential retraction (optional)
439
+ */
440
+ receiveInteractionWithTime?(
441
+ interactionClass: InteractionClassHandle,
442
+ parameterValues: ParameterHandleValueMap,
443
+ userSuppliedTag: UserSuppliedTag,
444
+ transportationType: TransportationTypeHandle,
445
+ producingFederate: FederateHandle,
446
+ sentRegions: ConveyedRegionSet | undefined,
447
+ time: LogicalTime,
448
+ sentOrderType: OrderType,
449
+ receivedOrderType: OrderType,
450
+ retractionHandle?: MessageRetractionHandle
451
+ ): void;
452
+
453
+ /**
454
+ * Called when a directed interaction is received without time.
455
+ * (Directed interactions target a specific object instance)
456
+ *
457
+ * @param interactionClass - Handle of the interaction class
458
+ * @param objectInstance - Handle of the target object
459
+ * @param parameterValues - Map of parameter handles to values
460
+ * @param userSuppliedTag - User-supplied tag
461
+ * @param transportationType - Transportation type used
462
+ * @param producingFederate - Handle of the sending federate
463
+ */
464
+ receiveDirectedInteraction?(
465
+ interactionClass: InteractionClassHandle,
466
+ objectInstance: ObjectInstanceHandle,
467
+ parameterValues: ParameterHandleValueMap,
468
+ userSuppliedTag: UserSuppliedTag,
469
+ transportationType: TransportationTypeHandle,
470
+ producingFederate: FederateHandle
471
+ ): void;
472
+
473
+ /**
474
+ * Called when a directed interaction is received with time.
475
+ *
476
+ * @param interactionClass - Handle of the interaction class
477
+ * @param objectInstance - Handle of the target object
478
+ * @param parameterValues - Map of parameter handles to values
479
+ * @param userSuppliedTag - User-supplied tag
480
+ * @param transportationType - Transportation type used
481
+ * @param producingFederate - Handle of the sending federate
482
+ * @param time - Logical time of interaction
483
+ * @param sentOrderType - Order type used by sender
484
+ * @param receivedOrderType - Order type as received
485
+ * @param retractionHandle - Handle for potential retraction (optional)
486
+ */
487
+ receiveDirectedInteractionWithTime?(
488
+ interactionClass: InteractionClassHandle,
489
+ objectInstance: ObjectInstanceHandle,
490
+ parameterValues: ParameterHandleValueMap,
491
+ userSuppliedTag: UserSuppliedTag,
492
+ transportationType: TransportationTypeHandle,
493
+ producingFederate: FederateHandle,
494
+ time: LogicalTime,
495
+ sentOrderType: OrderType,
496
+ receivedOrderType: OrderType,
497
+ retractionHandle?: MessageRetractionHandle
498
+ ): void;
499
+
500
+ // ===========================================================================
501
+ // Object Management - Attribute Value Update Requests
502
+ // ===========================================================================
503
+
504
+ /**
505
+ * Called when another federate requests attribute value updates.
506
+ *
507
+ * @param objectInstance - Handle of the object
508
+ * @param attributes - Set of attributes to update
509
+ * @param userSuppliedTag - User-supplied tag
510
+ */
511
+ provideAttributeValueUpdate?(
512
+ objectInstance: ObjectInstanceHandle,
513
+ attributes: AttributeHandleSet,
514
+ userSuppliedTag: UserSuppliedTag
515
+ ): void;
516
+
517
+ /**
518
+ * Called when updates should be turned on for an object instance.
519
+ *
520
+ * @param objectInstance - Handle of the object
521
+ * @param attributes - Set of attributes
522
+ */
523
+ turnUpdatesOnForObjectInstance?(
524
+ objectInstance: ObjectInstanceHandle,
525
+ attributes: AttributeHandleSet
526
+ ): void;
527
+
528
+ /**
529
+ * Called when updates should be turned on with a specific rate.
530
+ *
531
+ * @param objectInstance - Handle of the object
532
+ * @param attributes - Set of attributes
533
+ * @param updateRateDesignator - Update rate identifier
534
+ */
535
+ turnUpdatesOnForObjectInstanceWithRate?(
536
+ objectInstance: ObjectInstanceHandle,
537
+ attributes: AttributeHandleSet,
538
+ updateRateDesignator: string
539
+ ): void;
540
+
541
+ /**
542
+ * Called when updates should be turned off for an object instance.
543
+ *
544
+ * @param objectInstance - Handle of the object
545
+ * @param attributes - Set of attributes
546
+ */
547
+ turnUpdatesOffForObjectInstance?(
548
+ objectInstance: ObjectInstanceHandle,
549
+ attributes: AttributeHandleSet
550
+ ): void;
551
+
552
+ // ===========================================================================
553
+ // Object Management - Attribute Scope
554
+ // ===========================================================================
555
+
556
+ /**
557
+ * Called when attributes come into scope.
558
+ *
559
+ * @param objectInstance - Handle of the object
560
+ * @param attributes - Set of attributes that came into scope
561
+ */
562
+ attributesInScope?(
563
+ objectInstance: ObjectInstanceHandle,
564
+ attributes: AttributeHandleSet
565
+ ): void;
566
+
567
+ /**
568
+ * Called when attributes go out of scope.
569
+ *
570
+ * @param objectInstance - Handle of the object
571
+ * @param attributes - Set of attributes that went out of scope
572
+ */
573
+ attributesOutOfScope?(
574
+ objectInstance: ObjectInstanceHandle,
575
+ attributes: AttributeHandleSet
576
+ ): void;
577
+
578
+ // ===========================================================================
579
+ // Ownership Management
580
+ // ===========================================================================
581
+
582
+ /**
583
+ * Called to request assumption of attribute ownership.
584
+ *
585
+ * @param objectInstance - Handle of the object
586
+ * @param attributes - Set of attributes to assume ownership of
587
+ * @param userSuppliedTag - User-supplied tag
588
+ */
589
+ requestAttributeOwnershipAssumption?(
590
+ objectInstance: ObjectInstanceHandle,
591
+ attributes: AttributeHandleSet,
592
+ userSuppliedTag: UserSuppliedTag
593
+ ): void;
594
+
595
+ /**
596
+ * Called to request divestiture confirmation.
597
+ *
598
+ * @param objectInstance - Handle of the object
599
+ * @param attributes - Set of attributes to divest
600
+ */
601
+ requestDivestitureConfirmation?(
602
+ objectInstance: ObjectInstanceHandle,
603
+ attributes: AttributeHandleSet
604
+ ): void;
605
+
606
+ /**
607
+ * Called when attribute ownership acquisition succeeds.
608
+ *
609
+ * @param objectInstance - Handle of the object
610
+ * @param attributes - Set of acquired attributes
611
+ * @param userSuppliedTag - User-supplied tag
612
+ */
613
+ attributeOwnershipAcquisitionNotification?(
614
+ objectInstance: ObjectInstanceHandle,
615
+ attributes: AttributeHandleSet,
616
+ userSuppliedTag: UserSuppliedTag
617
+ ): void;
618
+
619
+ /**
620
+ * Called when requested attributes are unavailable for acquisition.
621
+ *
622
+ * @param objectInstance - Handle of the object
623
+ * @param attributes - Set of unavailable attributes
624
+ */
625
+ attributeOwnershipUnavailable?(
626
+ objectInstance: ObjectInstanceHandle,
627
+ attributes: AttributeHandleSet
628
+ ): void;
629
+
630
+ /**
631
+ * Called when another federate requests release of attribute ownership.
632
+ *
633
+ * @param objectInstance - Handle of the object
634
+ * @param attributes - Set of attributes to release
635
+ * @param userSuppliedTag - User-supplied tag
636
+ */
637
+ requestAttributeOwnershipRelease?(
638
+ objectInstance: ObjectInstanceHandle,
639
+ attributes: AttributeHandleSet,
640
+ userSuppliedTag: UserSuppliedTag
641
+ ): void;
642
+
643
+ /**
644
+ * Called to confirm cancellation of attribute ownership acquisition.
645
+ *
646
+ * @param objectInstance - Handle of the object
647
+ * @param attributes - Set of attributes whose acquisition was cancelled
648
+ */
649
+ confirmAttributeOwnershipAcquisitionCancellation?(
650
+ objectInstance: ObjectInstanceHandle,
651
+ attributes: AttributeHandleSet
652
+ ): void;
653
+
654
+ /**
655
+ * Reports attribute ownership status.
656
+ *
657
+ * @param objectInstance - Handle of the object
658
+ * @param attribute - Handle of the attribute
659
+ * @param owner - Handle of the owning federate
660
+ */
661
+ informAttributeOwnership?(
662
+ objectInstance: ObjectInstanceHandle,
663
+ attribute: AttributeHandle,
664
+ owner: FederateHandle
665
+ ): void;
666
+
667
+ /**
668
+ * Reports that an attribute is not owned.
669
+ *
670
+ * @param objectInstance - Handle of the object
671
+ * @param attribute - Handle of the attribute
672
+ */
673
+ attributeIsNotOwned?(
674
+ objectInstance: ObjectInstanceHandle,
675
+ attribute: AttributeHandle
676
+ ): void;
677
+
678
+ /**
679
+ * Reports that an attribute is owned by the RTI.
680
+ *
681
+ * @param objectInstance - Handle of the object
682
+ * @param attribute - Handle of the attribute
683
+ */
684
+ attributeIsOwnedByRTI?(
685
+ objectInstance: ObjectInstanceHandle,
686
+ attribute: AttributeHandle
687
+ ): void;
688
+
689
+ // ===========================================================================
690
+ // Time Management
691
+ // ===========================================================================
692
+
693
+ /**
694
+ * Called when time regulation is enabled.
695
+ *
696
+ * @param time - The federate's logical time
697
+ */
698
+ timeRegulationEnabled?(time: LogicalTime): void;
699
+
700
+ /**
701
+ * Called when time constrained mode is enabled.
702
+ *
703
+ * @param time - The federate's logical time
704
+ */
705
+ timeConstrainedEnabled?(time: LogicalTime): void;
706
+
707
+ /**
708
+ * Called when a time advance is granted.
709
+ *
710
+ * @param time - The granted logical time
711
+ */
712
+ timeAdvanceGrant?(time: LogicalTime): void;
713
+
714
+ /**
715
+ * Called when a flush queue grant is received.
716
+ *
717
+ * @param time - The granted logical time
718
+ */
719
+ flushQueueGrant?(time: LogicalTime): void;
720
+
721
+ /**
722
+ * Called to request retraction of a previously sent message.
723
+ *
724
+ * @param retractionHandle - Handle of the message to retract
725
+ */
726
+ requestRetraction?(retractionHandle: MessageRetractionHandle): void;
727
+
728
+ // ===========================================================================
729
+ // Transportation Type Change Confirmations
730
+ // ===========================================================================
731
+
732
+ /**
733
+ * Confirms attribute transportation type change.
734
+ *
735
+ * @param objectInstance - Handle of the object
736
+ * @param attributes - Set of affected attributes
737
+ * @param transportationType - The new transportation type
738
+ */
739
+ confirmAttributeTransportationTypeChange?(
740
+ objectInstance: ObjectInstanceHandle,
741
+ attributes: AttributeHandleSet,
742
+ transportationType: TransportationTypeHandle
743
+ ): void;
744
+
745
+ /**
746
+ * Reports attribute transportation type.
747
+ *
748
+ * @param objectInstance - Handle of the object
749
+ * @param attribute - Handle of the attribute
750
+ * @param transportationType - The transportation type
751
+ */
752
+ reportAttributeTransportationType?(
753
+ objectInstance: ObjectInstanceHandle,
754
+ attribute: AttributeHandle,
755
+ transportationType: TransportationTypeHandle
756
+ ): void;
757
+
758
+ /**
759
+ * Confirms interaction transportation type change.
760
+ *
761
+ * @param interactionClass - Handle of the interaction class
762
+ * @param transportationType - The new transportation type
763
+ */
764
+ confirmInteractionTransportationTypeChange?(
765
+ interactionClass: InteractionClassHandle,
766
+ transportationType: TransportationTypeHandle
767
+ ): void;
768
+
769
+ /**
770
+ * Reports interaction transportation type.
771
+ *
772
+ * @param federateHandle - Handle of the federate
773
+ * @param interactionClass - Handle of the interaction class
774
+ * @param transportationType - The transportation type
775
+ */
776
+ reportInteractionTransportationType?(
777
+ federateHandle: FederateHandle,
778
+ interactionClass: InteractionClassHandle,
779
+ transportationType: TransportationTypeHandle
780
+ ): void;
781
+ }
782
+
783
+ /**
784
+ * Empty/no-op implementation of FederateAmbassador.
785
+ * Useful as a base class or for testing.
786
+ */
787
+ export class NullFederateAmbassador implements FederateAmbassador {
788
+ // All methods are undefined by default
789
+ }
790
+
791
+ /**
792
+ * Base class for FederateAmbassador implementations that provides
793
+ * default no-op implementations for all callbacks.
794
+ *
795
+ * Extend this class and override only the callbacks you need.
796
+ *
797
+ * @example
798
+ * ```ts
799
+ * class MyFederateAmbassador extends BaseFederateAmbassador {
800
+ * override discoverObjectInstance(
801
+ * objectInstance: ObjectInstanceHandle,
802
+ * objectClass: ObjectClassHandle,
803
+ * objectInstanceName: string,
804
+ * producingFederate: FederateHandle
805
+ * ): void {
806
+ * console.log(`Discovered: ${objectInstanceName}`);
807
+ * }
808
+ * }
809
+ * ```
810
+ */
811
+ export abstract class BaseFederateAmbassador implements FederateAmbassador {
812
+ connectionLost(_faultDescription: string): void {}
813
+ reportFederationExecutions(_federations: FederationExecutionInformationSet): void {}
814
+ reportFederationExecutionMembers(_federationName: string, _members: FederationExecutionMemberInformationSet): void {}
815
+ reportFederationExecutionDoesNotExist(_federationName: string): void {}
816
+ federateResigned(_reasonForResignDescription: string): void {}
817
+ synchronizationPointRegistrationSucceeded(_label: string): void {}
818
+ synchronizationPointRegistrationFailed(_label: string, _reason: SynchronizationPointFailureReason): void {}
819
+ announceSynchronizationPoint(_label: string, _userSuppliedTag: UserSuppliedTag): void {}
820
+ federationSynchronized(_label: string, _failedToSyncSet: FederateHandle[]): void {}
821
+ initiateFederateSave(_label: string): void {}
822
+ initiateFederateSaveWithTime(_label: string, _time: LogicalTime): void {}
823
+ federationSaved(): void {}
824
+ federationNotSaved(_reason: SaveFailureReason): void {}
825
+ federationSaveStatusResponse(_saveStatusPairs: FederateHandleSaveStatusPairArray): void {}
826
+ requestFederationRestoreSucceeded(_label: string): void {}
827
+ requestFederationRestoreFailed(_label: string): void {}
828
+ federationRestoreBegun(): void {}
829
+ initiateFederateRestore(_label: string, _federateName: string, _postRestoreFederateHandle: FederateHandle): void {}
830
+ federationRestored(): void {}
831
+ federationNotRestored(_reason: RestoreFailureReason): void {}
832
+ federationRestoreStatusResponse(_restoreStatuses: FederateRestoreStatusArray): void {}
833
+ startRegistrationForObjectClass(_objectClass: ObjectClassHandle): void {}
834
+ stopRegistrationForObjectClass(_objectClass: ObjectClassHandle): void {}
835
+ turnInteractionsOn(_interactionClass: InteractionClassHandle): void {}
836
+ turnInteractionsOff(_interactionClass: InteractionClassHandle): void {}
837
+ objectInstanceNameReservationSucceeded(_objectInstanceName: string): void {}
838
+ objectInstanceNameReservationFailed(_objectInstanceName: string): void {}
839
+ multipleObjectInstanceNameReservationSucceeded(_objectInstanceNames: string[]): void {}
840
+ multipleObjectInstanceNameReservationFailed(_objectInstanceNames: string[]): void {}
841
+ discoverObjectInstance(_objectInstance: ObjectInstanceHandle, _objectClass: ObjectClassHandle, _objectInstanceName: string, _producingFederate: FederateHandle): void {}
842
+ removeObjectInstance(_objectInstance: ObjectInstanceHandle, _userSuppliedTag: UserSuppliedTag, _producingFederate: FederateHandle): void {}
843
+ removeObjectInstanceWithTime(_objectInstance: ObjectInstanceHandle, _userSuppliedTag: UserSuppliedTag, _producingFederate: FederateHandle, _time: LogicalTime, _sentOrderType: OrderType, _receivedOrderType: OrderType, _retractionHandle?: MessageRetractionHandle): void {}
844
+ reflectAttributeValues(_objectInstance: ObjectInstanceHandle, _attributeValues: AttributeHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle, _sentRegions?: ConveyedRegionSet): void {}
845
+ reflectAttributeValuesWithTime(_objectInstance: ObjectInstanceHandle, _attributeValues: AttributeHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle, _sentRegions: ConveyedRegionSet | undefined, _time: LogicalTime, _sentOrderType: OrderType, _receivedOrderType: OrderType, _retractionHandle?: MessageRetractionHandle): void {}
846
+ receiveInteraction(_interactionClass: InteractionClassHandle, _parameterValues: ParameterHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle, _sentRegions?: ConveyedRegionSet): void {}
847
+ receiveInteractionWithTime(_interactionClass: InteractionClassHandle, _parameterValues: ParameterHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle, _sentRegions: ConveyedRegionSet | undefined, _time: LogicalTime, _sentOrderType: OrderType, _receivedOrderType: OrderType, _retractionHandle?: MessageRetractionHandle): void {}
848
+ receiveDirectedInteraction(_interactionClass: InteractionClassHandle, _objectInstance: ObjectInstanceHandle, _parameterValues: ParameterHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle): void {}
849
+ receiveDirectedInteractionWithTime(_interactionClass: InteractionClassHandle, _objectInstance: ObjectInstanceHandle, _parameterValues: ParameterHandleValueMap, _userSuppliedTag: UserSuppliedTag, _transportationType: TransportationTypeHandle, _producingFederate: FederateHandle, _time: LogicalTime, _sentOrderType: OrderType, _receivedOrderType: OrderType, _retractionHandle?: MessageRetractionHandle): void {}
850
+ provideAttributeValueUpdate(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _userSuppliedTag: UserSuppliedTag): void {}
851
+ turnUpdatesOnForObjectInstance(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
852
+ turnUpdatesOnForObjectInstanceWithRate(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _updateRateDesignator: string): void {}
853
+ turnUpdatesOffForObjectInstance(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
854
+ attributesInScope(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
855
+ attributesOutOfScope(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
856
+ requestAttributeOwnershipAssumption(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _userSuppliedTag: UserSuppliedTag): void {}
857
+ requestDivestitureConfirmation(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
858
+ attributeOwnershipAcquisitionNotification(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _userSuppliedTag: UserSuppliedTag): void {}
859
+ attributeOwnershipUnavailable(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
860
+ requestAttributeOwnershipRelease(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _userSuppliedTag: UserSuppliedTag): void {}
861
+ confirmAttributeOwnershipAcquisitionCancellation(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet): void {}
862
+ informAttributeOwnership(_objectInstance: ObjectInstanceHandle, _attribute: AttributeHandle, _owner: FederateHandle): void {}
863
+ attributeIsNotOwned(_objectInstance: ObjectInstanceHandle, _attribute: AttributeHandle): void {}
864
+ attributeIsOwnedByRTI(_objectInstance: ObjectInstanceHandle, _attribute: AttributeHandle): void {}
865
+ timeRegulationEnabled(_time: LogicalTime): void {}
866
+ timeConstrainedEnabled(_time: LogicalTime): void {}
867
+ timeAdvanceGrant(_time: LogicalTime): void {}
868
+ flushQueueGrant(_time: LogicalTime): void {}
869
+ requestRetraction(_retractionHandle: MessageRetractionHandle): void {}
870
+ confirmAttributeTransportationTypeChange(_objectInstance: ObjectInstanceHandle, _attributes: AttributeHandleSet, _transportationType: TransportationTypeHandle): void {}
871
+ reportAttributeTransportationType(_objectInstance: ObjectInstanceHandle, _attribute: AttributeHandle, _transportationType: TransportationTypeHandle): void {}
872
+ confirmInteractionTransportationTypeChange(_interactionClass: InteractionClassHandle, _transportationType: TransportationTypeHandle): void {}
873
+ reportInteractionTransportationType(_federateHandle: FederateHandle, _interactionClass: InteractionClassHandle, _transportationType: TransportationTypeHandle): void {}
874
+ }