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 hinted deserializer support #82

Merged
merged 2 commits into from Jul 13, 2014
Merged

Add hinted deserializer support #82

merged 2 commits into from Jul 13, 2014

Conversation

nefilim
Copy link
Contributor

@nefilim nefilim commented Jun 27, 2014

This PR adds a

def deserializePayload(payload: Array[Byte], payloadType: String): GeneratedMessageLite

and associated support structures to the generated Scala code. This comes in handy when using protobuf as payload in a (framed) protocol and avoiding using reflection at runtime.

I initially tried doing this with a macro which worked ok, except I couldn't find a way to enumerate the objects in the generated package (by scalabuff). I need to iterate them (protobuf messages basically) to generate a hint map. It's far simpler to achieve the same result just doing code generation as part of scalabuff.

@SandroGrzicic
Copy link
Owner

Looks good at first glance. Any chance of adding a test as well? Thanks.

SandroGrzicic added a commit that referenced this pull request Jul 13, 2014
Add hinted deserializer support
@SandroGrzicic SandroGrzicic merged commit de76662 into SandroGrzicic:master Jul 13, 2014
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.

None yet

2 participants