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

Add OpenSim::AbstractSocket::canConnectTo(Object const&) const #3451

Closed
adamkewley opened this issue May 16, 2023 · 1 comment
Closed

Add OpenSim::AbstractSocket::canConnectTo(Object const&) const #3451

adamkewley opened this issue May 16, 2023 · 1 comment

Comments

@adamkewley
Copy link
Contributor

Currently, the only way to test whether a socket can be connected to an object is to call AbstractSocket::connect(Object const&) in a try {} catch {} block and see if any sparks fly. This is problematic if (e.g.) you need to write a UI that lists all objects in an OpenSim::Model that can be connected to, because that requires iterating over many objects and (slowly) throwing many exceptions.

That use-case was triggered when developing OSC's socket editor (issue). I got around it by caching a list of connectees once, but it would be better to avoid exceptions altogether.

@adamkewley
Copy link
Contributor Author

Fixed in the PR

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

No branches or pull requests

1 participant