Skip to content

Conversation

szehetner
Copy link
Contributor

This adds two new members to the generated C# messages. Both of these are already available in the generated Java classes, but were missing in the C# version.

public const int <FieldMember>Offset
This is useful if you need to read/write a member with some other method than the generated accessors, e.g. read a fixed-length byte array as a ReadOnlySpan<byte>. Currently these offsets need to be hardcoded.

public void WrapForEncodeAndApplyHeader(DirectBuffer buffer, int offset, MessageHeader headerEncoder)
Generates the repetitive code to fill the header. Same as "wrapAndApplyHeader" in Java.

@vyazelenko
Copy link
Contributor

@szehetner The build fails with the Checkstyle error, i.e.:

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java:1038: Line is longer than 120 characters (found 137). [LineLength]

@szehetner
Copy link
Contributor Author

@vyazelenko Thanks, forgot to run the full gradle build locally.

@mjpt777 mjpt777 merged commit 6cd1a11 into aeron-io:master May 4, 2020
@szehetner szehetner deleted the csharp-api branch May 5, 2020 06:35
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.

3 participants