Skip to main content

Module instance_tracker

Module instance_tracker 

Source
Expand description

InstanceTracker — the central bookkeeping for keyed topic instances, on both the writer and the reader side.

Spec reference: OMG DDS-DCPS 1.4 §2.2.2.4.2.5 (register_instance), §2.2.2.4.2.7 (unregister_instance), §2.2.2.4.2.10 (dispose), §2.2.2.4.2.13 (get_key_value), §2.2.2.4.2.14 (lookup_instance), §2.2.2.5.1 (InstanceStateKind).

§Data model

We index instances by the 16-byte KeyHash (XTypes 1.3 §7.6.8). Per instance we keep:

  • the assigned InstanceHandle,
  • the lifecycle state (InstanceStateKind),
  • the generation counters (disposed, no_writers),
  • the number of still-registered writers (reader side),
  • the last observed sample timestamp.

KeyHash → handle is a 1:1 map for the lifetime of the tracker (handles are not recycled, even once the instance is disposed + purged; the spec explicitly allows recycling, but we avoid it for test stability).

Structs§

InstanceState
Per-instance bookkeeping.
InstanceTracker
Thread-safe tracker — instantiated in both the DataWriter and the DataReader.

Type Aliases§

KeyHash
16-byte KeyHash used as index.