> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sensor-bridge/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sensor-bridge/_mcp/server.

# hololink::emulation::get_or_create_dp_sensor_registers

> Look up (or lazily create) the DPSensorRegisters slice for sensor_id, growing ctxt.dp_sensor_registers_cache as needed so that ctxt.dp_sensor_registers_cache[sensor_id] is the live slot.

```cpp showLineNumbers={false}
DPSensorRegisters * hololink::emulation::get_or_create_dp_sensor_registers(
    LinuxHSBEmulatorCtxt &ctxt,
    uint8_t sensor_id
)
```

Look up (or lazily create) the [DPSensorRegisters](../structs/dpsensorregisters) slice for sensor\_id, growing ctxt.dp\_sensor\_registers\_cache as needed so that ctxt.dp\_sensor\_registers\_cache\[sensor\_id] is the live slot.

Calling with the same sensor\_id returns the same pointer.

Free function (not a class method) so the public [HSBEmulator](../classes/hsbemulator) interface stays unchanged. Not thread-safe; [DataPlane](../classes/dataplane) construction is expected to be single-threaded.