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

Some common interfaces / abstract classes for SBE codecs #751

Closed
RichardWarburton opened this issue Feb 11, 2020 · 4 comments
Closed

Some common interfaces / abstract classes for SBE codecs #751

RichardWarburton opened this issue Feb 11, 2020 · 4 comments

Comments

@RichardWarburton
Copy link
Contributor

RichardWarburton commented Feb 11, 2020

If you're writing a library or framework that uses SBE codecs it's very hard to abstract over common operations from SBE codecs. This could be resolved with the addition of a common interface or abstract class. The kind of common operations that would be useful to abstract over would be:

  • int sbeBlockLength()
  • StringBuilder appendTo(final StringBuilder builder)
  • int sbeTemplateId()
  • int sbeSchemaId()
  • int sbeSchemaVersion()
  • Encoder wrap(final MutableDirectBuffer buffer, final int offset)
  • Encoder wrapAndApplyHeader( final MutableDirectBuffer buffer, final int offset, final MessageHeaderEncoder headerEncoder)

I'm happy to spend time to implement this - I don't think it would take long to be honest but I wanted to open an issue for feedback / discussion before starting.

@mjpt777
Copy link
Contributor

mjpt777 commented Feb 11, 2020

@RichardWarburton
Copy link
Contributor Author

Thanks for pointing that out @mjpt777 - is there a configuration option that I need to use in order to generate them? At the moment all the codecs that I've seen generated don't implement these interfaces.

@mjpt777
Copy link
Contributor

mjpt777 commented Feb 11, 2020

@RichardWarburton
Copy link
Contributor Author

Thanks.

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

2 participants