Skip to content

Commit 90566bf

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents d822c5c + 8f6c32c commit 90566bf

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed
2 Bytes
Binary file not shown.

examples/csharp/generated_stub/generated/Car.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class Car
1010
public const ushort TemplateId = (ushort)1;
1111
public const byte TemplateVersion = (byte)0;
1212
public const ushort BlockLength = (ushort)45;
13+
public const string SematicType = "";
1314

1415
private readonly Car _parentMessage;
1516
private DirectBuffer _buffer;
@@ -577,9 +578,9 @@ public static string OctaneRatingMetaAttribute(MetaAttribute metaAttribute)
577578

578579
public const byte OctaneRatingNullVal = (byte)255;
579580

580-
public const byte OctaneRatingMinVal = (byte)0;
581+
public const byte OctaneRatingMinVal = (byte)90;
581582

582-
public const byte OctaneRatingMaxVal = (byte)254;
583+
public const byte OctaneRatingMaxVal = (byte)110;
583584

584585
public byte OctaneRating
585586
{

main/csharp/ir/generated/FrameCodec.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class FrameCodec
1010
public const ushort TemplateId = (ushort)1;
1111
public const byte TemplateVersion = (byte)0;
1212
public const ushort BlockLength = (ushort)8;
13+
public const string SematicType = "";
1314

1415
private readonly FrameCodec _parentMessage;
1516
private DirectBuffer _buffer;

main/csharp/ir/generated/TokenCodec.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class TokenCodec
1010
public const ushort TemplateId = (ushort)2;
1111
public const byte TemplateVersion = (byte)0;
1212
public const ushort BlockLength = (ushort)20;
13+
public const string SematicType = "";
1314

1415
private readonly TokenCodec _parentMessage;
1516
private DirectBuffer _buffer;

main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void generate() throws IOException
108108
{
109109
out.append(generateFileHeader(ir.applicableNamespace()));
110110
out.append(generateClassDeclaration(className));
111-
out.append(generateMessageFlyweightCode(className, msgToken.size(), msgToken.version(), msgToken.schemaId()));
111+
out.append(generateMessageFlyweightCode(className, msgToken));
112112

113113
final List<Token> messageBody = tokens.subList(1, tokens.size() - 1);
114114
int offset = 0;
@@ -928,19 +928,18 @@ private CharSequence generateFixedFlyweightCode(final int size)
928928
);
929929
}
930930

931-
private CharSequence generateMessageFlyweightCode(final String className,
932-
final int blockLength,
933-
final int version,
934-
final int schemaId)
931+
private CharSequence generateMessageFlyweightCode(final String className, final Token token)
935932
{
936933
final String blockLengthType = cSharpTypeName(ir.headerStructure().blockLengthType());
937934
final String templateIdType = cSharpTypeName(ir.headerStructure().templateIdType());
938935
final String templateVersionType = cSharpTypeName(ir.headerStructure().templateVersionType());
936+
final String semanticType = token.encoding().semanticType() == null ? "" : token.encoding().semanticType();
939937

940938
return String.format(
941939
" public const %s TemplateId = %s;\n" +
942940
" public const %s TemplateVersion = %s;\n" +
943-
" public const %s BlockLength = %s;\n\n" +
941+
" public const %s BlockLength = %s;\n" +
942+
" public const string SematicType = \"%s\";\n\n" +
944943
" private readonly %s _parentMessage;\n" +
945944
" private DirectBuffer _buffer;\n" +
946945
" private int _offset;\n" +
@@ -990,11 +989,12 @@ private CharSequence generateMessageFlyweightCode(final String className,
990989
" }\n" +
991990
" }\n\n",
992991
templateIdType,
993-
generateLiteral(ir.headerStructure().templateIdType(), Integer.toString(schemaId)),
992+
generateLiteral(ir.headerStructure().templateIdType(), Integer.toString(token.schemaId())),
994993
templateVersionType,
995-
generateLiteral(ir.headerStructure().templateVersionType(), Integer.toString(version)),
994+
generateLiteral(ir.headerStructure().templateVersionType(), Integer.toString(token.version())),
996995
blockLengthType,
997-
generateLiteral(ir.headerStructure().blockLengthType(), Integer.toString(blockLength)),
996+
generateLiteral(ir.headerStructure().blockLengthType(), Integer.toString(token.size())),
997+
semanticType,
998998
className,
999999
className
10001000
);

vs2013/TrackJavaCommits.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
This file contains the list of commits of Java ported to .NET (most recent at the TOP)
22

3+
94eead5798df8f7c2d7f4ccbb5692ce8856872a5
4+
[Java]: Added semanticType() method to the java generated message stubs. Enhancement #72.
5+
36
63931461c7f520deda6faa24ae6aef0c07417360
47
Added support for having a sbe.target.namespace system property override the package in the schema . Enhancement #63.
58

0 commit comments

Comments
 (0)