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

RSDK-9549: Make RpcSubtype model api ResourceRPCSubtype #349

Merged
merged 12 commits into from
Jan 9, 2025

Conversation

lia-viam
Copy link
Contributor

@lia-viam lia-viam commented Jan 6, 2025

Changes the implementation of an SDK type to more closely model its corresponding API type. Note that handler_map.cpp contains what is more or less the to_proto and from_proto of RPCSubtype, so we remove the ServiceDescriptor member.

The comparison operators in this and some other classes have been optimized to not construct a concatenated string every time they're called

Also includes some drive-by changes for domino-effect missing includes, minor cleanups, etc

Per @stuqdog we're not sure why RPCSubtype originally had a ServiceDescriptor member--it seems its only use was in using the DebugString to implement operator< to make RPCSubtype usable as a map key. I'm not sure what tests if any will exercise that this is still behaving as expected or if we know why this might have been implemented that way in the first place, cc @acmorrow for any ideas or sugestions

@lia-viam lia-viam requested review from acmorrow and stuqdog January 6, 2025 22:31
@lia-viam lia-viam requested a review from a team as a code owner January 6, 2025 22:31
@lia-viam lia-viam requested review from njooma and removed request for a team January 6, 2025 22:31
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

lgtm though per offline conversation, before we merge I would love to see confirmation that we can actually run this and use resources (both built-ins and new modular types) after removing the ServiceDescriptor.


class HandlerMap;

}
Copy link
Member

Choose a reason for hiding this comment

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

(nit) should have // namespace v1 at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

grr yes clang-format loves to not put them in

@lia-viam
Copy link
Contributor Author

lia-viam commented Jan 9, 2025

Validated with a test robot on app dot viam that we were still able to get components/modules and exercise methods on them

@lia-viam lia-viam merged commit 0e9ccd5 into viamrobotics:main Jan 9, 2025
4 checks passed
@lia-viam lia-viam deleted the rpc-subtype branch January 9, 2025 19:02
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