Retrieve trackers Impl from session where it is stored#34
Merged
aristarkhovNV merged 6 commits intomainfrom Jan 8, 2026
Merged
Retrieve trackers Impl from session where it is stored#34aristarkhovNV merged 6 commits intomainfrom
aristarkhovNV merged 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the device tracker architecture to retrieve tracker implementations from the session where they are stored, rather than caching them in individual tracker objects. The change moves from a weak pointer caching pattern in each tracker to a centralized lookup system in DeviceIOSession.
Key Changes:
- Tracker query methods now require a
DeviceIOSessionparameter to retrieve their implementations - The
initialize()method is renamed tocreate_tracker()to better reflect its purpose - Tracker implementations are stored in a map within
DeviceIOSessioninstead of cached weak pointers in each tracker
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
deviceio_init.py |
Updated documentation to reflect new session parameter requirement |
deviceio_bindings.cpp |
Added lambda wrappers to pass session to tracker methods and added native() accessor |
tracker.hpp |
Renamed initialize() to create_tracker() |
headtracker.hpp |
Added session parameter to get_head() and removed cached implementation pointer |
handtracker.hpp |
Added session parameter to hand query methods and removed cached implementation pointer |
deviceio_session.hpp |
Changed storage from vector to map and added get_tracker_impl() lookup method |
controllertracker.hpp |
Added session parameter to get_controller_data() and removed cached implementation pointer |
headtracker.cpp |
Implemented session-based lookup and removed constructor/destructor |
handtracker.cpp |
Implemented session-based lookup and removed constructor/destructor |
deviceio_session.cpp |
Updated to use map storage and iterate over map entries |
controllertracker.cpp |
Implemented session-based lookup and removed constructor/destructor |
| Python examples | Updated all tracker method calls to pass the session parameter |
| C++ examples | Updated all tracker method calls to pass the session parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nvddr
approved these changes
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes a clear separation between Tracker definition and implementation. Tracker definition becomes a stateless immutable object that serves the following purposes:
Tracker::Impl is the implementation that contains session-specific state. Each
DeviceIOSessionsession maintains its own list of session-specific data. Tracker accessor looks-up its implementation from the session object.Impl life time is tied to the owning session. A live session must be explicitly passed to the tracker which enables the following: