Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singleton backend/device-watcher #12243

Merged
merged 3 commits into from
Oct 3, 2023
Merged

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Oct 1, 2023

  • Backend and the device-watcher are now both singletons, as it should be
  • Still, they are automatically destroyed (so the watcher stops watching, etc.) when they're no longer needed (when the last context its devices are removed) - and also automatically created when they're needed
  • Removed create_backend() from the backend.h header, so it's not possible for others to call it
  • Removed context.get_backend() - the backend is now only for backend_device objects
  • Renamed ds_device (recently added by myself) as backend_device and moved out of ds/

The backend is now mostly separate from the rest of librealsense and can be theoretically moved into its own module.

Tracked on [LRS-891]

@maloel maloel requested a review from Nir-Az October 1, 2023 16:49
// backend-singleton will stay alive.
//
// We are responsible for exposing the single notification from the platform-device-watcher to several subscribers:
// one device-watcher, but many contexts, each with futher subscriptions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

further?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maloel maloel merged commit 99c9420 into IntelRealSense:development Oct 3, 2023
@maloel maloel deleted the singleton branch October 3, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants