From 558df229057e80f7a131194e5d1119053ba7520a Mon Sep 17 00:00:00 2001 From: Zach Bray Date: Fri, 20 Oct 2023 11:06:17 +0100 Subject: [PATCH] [Java, C#, C++] Rename flags to enable field access order checking. The aim of this change is to avoid naming collisions with other flags, particularly in financial domains where "order" is used frequently. --- csharp/sbe-generated/sbe-generated.csproj | 4 +- .../sbe/generation/cpp/CppGenerator.java | 8 +- .../generation/csharp/CSharpGenerator.java | 10 +- .../sbe/generation/java/JavaGenerator.java | 12 +- .../sbe/ir/generated/FrameCodecDecoder.java | 50 +++--- .../sbe/ir/generated/FrameCodecEncoder.java | 32 ++-- .../sbe/ir/generated/TokenCodecDecoder.java | 168 +++++++++--------- .../sbe/ir/generated/TokenCodecEncoder.java | 94 +++++----- sbe-tool/src/test/cpp/CMakeLists.txt | 2 +- 9 files changed, 190 insertions(+), 190 deletions(-) diff --git a/csharp/sbe-generated/sbe-generated.csproj b/csharp/sbe-generated/sbe-generated.csproj index 362d85ba05..cedbc4321f 100644 --- a/csharp/sbe-generated/sbe-generated.csproj +++ b/csharp/sbe-generated/sbe-generated.csproj @@ -8,11 +8,11 @@ - TRACE,ENABLE_ACCESS_ORDER_CHECKS + TRACE,SBE_ENABLE_SEQUENCING_CHECKS - TRACE,ENABLE_ACCESS_ORDER_CHECKS + TRACE,SBE_ENABLE_SEQUENCING_CHECKS diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java index cb576f2e7b..074b479731 100755 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java @@ -207,7 +207,7 @@ private static CharSequence generateFullyEncodedCheck(final AccessOrderModel acc sb.append(indent).append("void checkEncodingIsComplete()\n") .append(indent).append("{\n") - .append("#if defined(ENABLE_ACCESS_ORDER_CHECKS)\n") + .append("#if defined(SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(indent).append(INDENT).append("switch (m_codecState)\n") .append(indent).append(INDENT).append("{\n"); @@ -321,7 +321,7 @@ private static CharSequence generateAccessOrderListenerCall( } final StringBuilder sb = new StringBuilder(); - sb.append("#if defined(ENABLE_ACCESS_ORDER_CHECKS)\n") + sb.append("#if defined(SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(indent).append(methodName).append("("); for (int i = 0; i < arguments.length; i++) @@ -3083,7 +3083,7 @@ private CharSequence generateDecoderWrapListenerCall(final AccessOrderModel acce if (accessOrderModel.versionCount() == 1) { final StringBuilder sb = new StringBuilder(); - sb.append("#if defined(ENABLE_ACCESS_ORDER_CHECKS)\n") + sb.append("#if defined(SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(TWO_INDENT).append("codecState(") .append(qualifiedStateCase(accessOrderModel.latestVersionWrappedState())).append(");\n") .append("#endif\n"); @@ -3101,7 +3101,7 @@ private CharSequence generateEncoderWrapListener(final AccessOrderModel accessOr } final StringBuilder sb = new StringBuilder(); - sb.append("#if defined(ENABLE_ACCESS_ORDER_CHECKS)\n") + sb.append("#if defined(SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(TWO_INDENT).append("codecState(") .append(qualifiedStateCase(accessOrderModel.latestVersionWrappedState())) .append(");\n") diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java index 815582bfd3..6d4f143fff 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java @@ -1583,7 +1583,7 @@ private static CharSequence generateFullyEncodedCheck( sb.append(indent).append("public void CheckEncodingIsComplete()\n") .append(indent).append("{\n") - .append("#if ENABLE_ACCESS_ORDER_CHECKS\n") + .append("#if SBE_ENABLE_SEQUENCING_CHECKS\n") .append(indent).append(INDENT).append("switch (_codecState)\n") .append(indent).append(INDENT).append("{\n"); @@ -1670,7 +1670,7 @@ private static CharSequence generateAccessOrderListenerCall( } final StringBuilder sb = new StringBuilder(); - sb.append("#if ENABLE_ACCESS_ORDER_CHECKS\n") + sb.append("#if SBE_ENABLE_SEQUENCING_CHECKS\n") .append(indent).append(methodName).append("("); for (int i = 0; i < arguments.length; i++) @@ -1936,7 +1936,7 @@ private CharSequence generateEncoderWrapListener( } final StringBuilder sb = new StringBuilder(); - sb.append("#if ENABLE_ACCESS_ORDER_CHECKS\n") + sb.append("#if SBE_ENABLE_SEQUENCING_CHECKS\n") .append(indent).append("codecState(") .append(qualifiedStateCase(accessOrderModel.latestVersionWrappedState())) .append(");\n") @@ -2556,7 +2556,7 @@ private CharSequence generateDisplay( append(sb, TWO_INDENT, " int originalLimit = this.Limit;"); if (null != accessOrderModel) { - sb.append("#if ENABLE_ACCESS_ORDER_CHECKS\n"); + sb.append("#if SBE_ENABLE_SEQUENCING_CHECKS\n"); append(sb, TWO_INDENT, " CodecState originalState = _codecState;"); sb.append(THREE_INDENT).append("_codecState = ") .append(qualifiedStateCase(accessOrderModel.notWrappedState())).append(";\n"); @@ -2588,7 +2588,7 @@ private CharSequence generateDisplay( sb.append('\n'); if (null != accessOrderModel) { - sb.append("#if ENABLE_ACCESS_ORDER_CHECKS\n"); + sb.append("#if SBE_ENABLE_SEQUENCING_CHECKS\n"); append(sb, TWO_INDENT, " _codecState = originalState;"); sb.append("#endif\n"); } diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java index 7ba6b3bcea..e969396f8c 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java @@ -307,9 +307,9 @@ private static CharSequence generateFieldOrderStates(final AccessOrderModel acce sb.append(" private static final boolean ENABLE_BOUNDS_CHECKS = ") .append("!Boolean.getBoolean(\"agrona.disable.bounds.checks\");\n\n"); - sb.append(" private static final boolean ENABLE_ACCESS_ORDER_CHECKS = ") + sb.append(" private static final boolean SBE_ENABLE_SEQUENCING_CHECKS = ") .append("Boolean.parseBoolean(System.getProperty(\n") - .append(" \"sbe.enable.access.order.checks\",\n") + .append(" \"sbe.enable.sequencing.checks\",\n") .append(" Boolean.toString(ENABLE_BOUNDS_CHECKS)));\n\n"); sb.append(" /**\n"); @@ -410,7 +410,7 @@ private static void generateFullyEncodedCheck( sb.append(" public void checkEncodingIsComplete()\n") .append(" {\n") - .append(" if (ENABLE_ACCESS_ORDER_CHECKS)\n") + .append(" if (SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(" {\n") .append(" switch (codecState)\n") .append(" {\n"); @@ -493,7 +493,7 @@ private static CharSequence generateAccessOrderListenerCall( } final StringBuilder sb = new StringBuilder(); - sb.append(indent).append("if (ENABLE_ACCESS_ORDER_CHECKS)\n") + sb.append(indent).append("if (SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(indent).append("{\n") .append(indent).append(" ").append(methodName).append("("); @@ -755,7 +755,7 @@ private CharSequence generateEncoderWrapListener( } final StringBuilder sb = new StringBuilder(); - sb.append(indent).append("if (ENABLE_ACCESS_ORDER_CHECKS)") + sb.append(indent).append("if (SBE_ENABLE_SEQUENCING_CHECKS)") .append("\n").append(indent).append("{\n") .append(indent).append(" codecState(") .append(qualifiedStateCase(accessOrderModel.latestVersionWrappedState())) @@ -3424,7 +3424,7 @@ private CharSequence generateDecoderFlyweightCode( if (null != accessOrderModel) { - methods.append(" if (ENABLE_ACCESS_ORDER_CHECKS)\n") + methods.append(" if (SBE_ENABLE_SEQUENCING_CHECKS)\n") .append(" {\n") .append(" codecState(currentCodecState);\n") .append(" }\n\n"); diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java index a65b6520bc..005faad113 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java @@ -13,8 +13,8 @@ public final class FrameCodecDecoder { private static final boolean ENABLE_BOUNDS_CHECKS = !Boolean.getBoolean("agrona.disable.bounds.checks"); - private static final boolean ENABLE_ACCESS_ORDER_CHECKS = Boolean.parseBoolean(System.getProperty( - "sbe.enable.access.order.checks", + private static final boolean SBE_ENABLE_SEQUENCING_CHECKS = Boolean.parseBoolean(System.getProperty( + "sbe.enable.sequencing.checks", Boolean.toString(ENABLE_BOUNDS_CHECKS))); /** @@ -172,7 +172,7 @@ public FrameCodecDecoder wrap( this.actingVersion = actingVersion; limit(offset + actingBlockLength); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onWrap(actingVersion); } @@ -213,7 +213,7 @@ public int sbeDecodedLength() final int decodedLength = encodedLength(); limit(currentLimit); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { codecState(currentCodecState); } @@ -299,7 +299,7 @@ public static int irIdMaxValue() public int irId() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onIrIdAccessed(); } @@ -366,7 +366,7 @@ public static int irVersionMaxValue() public int irVersion() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onIrVersionAccessed(); } @@ -433,7 +433,7 @@ public static int schemaVersionMaxValue() public int schemaVersion() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSchemaVersionAccessed(); } @@ -504,7 +504,7 @@ private void onPackageNameAccessed() public int packageNameLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameLengthAccessed(); } @@ -515,7 +515,7 @@ public int packageNameLength() public int skipPackageName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -531,7 +531,7 @@ public int skipPackageName() public int getPackageName(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -548,7 +548,7 @@ public int getPackageName(final MutableDirectBuffer dst, final int dstOffset, fi public int getPackageName(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -565,7 +565,7 @@ public int getPackageName(final byte[] dst, final int dstOffset, final int lengt public void wrapPackageName(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -579,7 +579,7 @@ public void wrapPackageName(final DirectBuffer wrapBuffer) public String packageName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -662,7 +662,7 @@ private void onNamespaceNameAccessed() public int namespaceNameLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameLengthAccessed(); } @@ -673,7 +673,7 @@ public int namespaceNameLength() public int skipNamespaceName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -689,7 +689,7 @@ public int skipNamespaceName() public int getNamespaceName(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -706,7 +706,7 @@ public int getNamespaceName(final MutableDirectBuffer dst, final int dstOffset, public int getNamespaceName(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -723,7 +723,7 @@ public int getNamespaceName(final byte[] dst, final int dstOffset, final int len public void wrapNamespaceName(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -737,7 +737,7 @@ public void wrapNamespaceName(final DirectBuffer wrapBuffer) public String namespaceName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -820,7 +820,7 @@ private void onSemanticVersionAccessed() public int semanticVersionLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionLengthAccessed(); } @@ -831,7 +831,7 @@ public int semanticVersionLength() public int skipSemanticVersion() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -847,7 +847,7 @@ public int skipSemanticVersion() public int getSemanticVersion(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -864,7 +864,7 @@ public int getSemanticVersion(final MutableDirectBuffer dst, final int dstOffset public int getSemanticVersion(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -881,7 +881,7 @@ public int getSemanticVersion(final byte[] dst, final int dstOffset, final int l public void wrapSemanticVersion(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -895,7 +895,7 @@ public void wrapSemanticVersion(final DirectBuffer wrapBuffer) public String semanticVersion() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java index 5d866e6dfc..ce88e4ed8c 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java @@ -13,8 +13,8 @@ public final class FrameCodecEncoder { private static final boolean ENABLE_BOUNDS_CHECKS = !Boolean.getBoolean("agrona.disable.bounds.checks"); - private static final boolean ENABLE_ACCESS_ORDER_CHECKS = Boolean.parseBoolean(System.getProperty( - "sbe.enable.access.order.checks", + private static final boolean SBE_ENABLE_SEQUENCING_CHECKS = Boolean.parseBoolean(System.getProperty( + "sbe.enable.sequencing.checks", Boolean.toString(ENABLE_BOUNDS_CHECKS))); /** @@ -151,7 +151,7 @@ public FrameCodecEncoder wrap(final MutableDirectBuffer buffer, final int offset this.offset = offset; limit(offset + BLOCK_LENGTH); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { codecState(CodecStates.V0_BLOCK); } @@ -245,7 +245,7 @@ public static int irIdMaxValue() public FrameCodecEncoder irId(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onIrIdAccessed(); } @@ -313,7 +313,7 @@ public static int irVersionMaxValue() public FrameCodecEncoder irVersion(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onIrVersionAccessed(); } @@ -381,7 +381,7 @@ public static int schemaVersionMaxValue() public FrameCodecEncoder schemaVersion(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSchemaVersionAccessed(); } @@ -438,7 +438,7 @@ public FrameCodecEncoder putPackageName(final DirectBuffer src, final int srcOff throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -459,7 +459,7 @@ public FrameCodecEncoder putPackageName(final byte[] src, final int srcOffset, f throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -483,7 +483,7 @@ public FrameCodecEncoder packageName(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPackageNameAccessed(); } @@ -544,7 +544,7 @@ public FrameCodecEncoder putNamespaceName(final DirectBuffer src, final int srcO throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -565,7 +565,7 @@ public FrameCodecEncoder putNamespaceName(final byte[] src, final int srcOffset, throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -589,7 +589,7 @@ public FrameCodecEncoder namespaceName(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNamespaceNameAccessed(); } @@ -650,7 +650,7 @@ public FrameCodecEncoder putSemanticVersion(final DirectBuffer src, final int sr throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -671,7 +671,7 @@ public FrameCodecEncoder putSemanticVersion(final byte[] src, final int srcOffse throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -695,7 +695,7 @@ public FrameCodecEncoder semanticVersion(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticVersionAccessed(); } @@ -734,7 +734,7 @@ public StringBuilder appendTo(final StringBuilder builder) public void checkEncodingIsComplete() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { switch (codecState) { diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java index 51a321ea99..e896601355 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java @@ -13,8 +13,8 @@ public final class TokenCodecDecoder { private static final boolean ENABLE_BOUNDS_CHECKS = !Boolean.getBoolean("agrona.disable.bounds.checks"); - private static final boolean ENABLE_ACCESS_ORDER_CHECKS = Boolean.parseBoolean(System.getProperty( - "sbe.enable.access.order.checks", + private static final boolean SBE_ENABLE_SEQUENCING_CHECKS = Boolean.parseBoolean(System.getProperty( + "sbe.enable.sequencing.checks", Boolean.toString(ENABLE_BOUNDS_CHECKS))); /** @@ -219,7 +219,7 @@ public TokenCodecDecoder wrap( this.actingVersion = actingVersion; limit(offset + actingBlockLength); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onWrap(actingVersion); } @@ -260,7 +260,7 @@ public int sbeDecodedLength() final int decodedLength = encodedLength(); limit(currentLimit); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { codecState(currentCodecState); } @@ -346,7 +346,7 @@ public static int tokenOffsetMaxValue() public int tokenOffset() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenOffsetAccessed(); } @@ -413,7 +413,7 @@ public static int tokenSizeMaxValue() public int tokenSize() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenSizeAccessed(); } @@ -480,7 +480,7 @@ public static int fieldIdMaxValue() public int fieldId() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onFieldIdAccessed(); } @@ -547,7 +547,7 @@ public static int tokenVersionMaxValue() public int tokenVersion() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenVersionAccessed(); } @@ -614,7 +614,7 @@ public static int componentTokenCountMaxValue() public int componentTokenCount() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onComponentTokenCountAccessed(); } @@ -666,7 +666,7 @@ private void onSignalAccessed() public short signalRaw() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSignalAccessed(); } @@ -676,7 +676,7 @@ public short signalRaw() public SignalCodec signal() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSignalAccessed(); } @@ -728,7 +728,7 @@ private void onPrimitiveTypeAccessed() public short primitiveTypeRaw() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPrimitiveTypeAccessed(); } @@ -738,7 +738,7 @@ public short primitiveTypeRaw() public PrimitiveTypeCodec primitiveType() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPrimitiveTypeAccessed(); } @@ -790,7 +790,7 @@ private void onByteOrderAccessed() public short byteOrderRaw() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onByteOrderAccessed(); } @@ -800,7 +800,7 @@ public short byteOrderRaw() public ByteOrderCodec byteOrder() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onByteOrderAccessed(); } @@ -852,7 +852,7 @@ private void onPresenceAccessed() public short presenceRaw() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPresenceAccessed(); } @@ -862,7 +862,7 @@ public short presenceRaw() public PresenceCodec presence() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPresenceAccessed(); } @@ -929,7 +929,7 @@ public static int deprecatedMaxValue() public int deprecated() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDeprecatedAccessed(); } @@ -1000,7 +1000,7 @@ private void onNameAccessed() public int nameLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameLengthAccessed(); } @@ -1011,7 +1011,7 @@ public int nameLength() public int skipName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1027,7 +1027,7 @@ public int skipName() public int getName(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1044,7 +1044,7 @@ public int getName(final MutableDirectBuffer dst, final int dstOffset, final int public int getName(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1061,7 +1061,7 @@ public int getName(final byte[] dst, final int dstOffset, final int length) public void wrapName(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1075,7 +1075,7 @@ public void wrapName(final DirectBuffer wrapBuffer) public String name() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1158,7 +1158,7 @@ private void onConstValueAccessed() public int constValueLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueLengthAccessed(); } @@ -1169,7 +1169,7 @@ public int constValueLength() public int skipConstValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1185,7 +1185,7 @@ public int skipConstValue() public int getConstValue(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1202,7 +1202,7 @@ public int getConstValue(final MutableDirectBuffer dst, final int dstOffset, fin public int getConstValue(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1219,7 +1219,7 @@ public int getConstValue(final byte[] dst, final int dstOffset, final int length public void wrapConstValue(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1233,7 +1233,7 @@ public void wrapConstValue(final DirectBuffer wrapBuffer) public String constValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1316,7 +1316,7 @@ private void onMinValueAccessed() public int minValueLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueLengthAccessed(); } @@ -1327,7 +1327,7 @@ public int minValueLength() public int skipMinValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1343,7 +1343,7 @@ public int skipMinValue() public int getMinValue(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1360,7 +1360,7 @@ public int getMinValue(final MutableDirectBuffer dst, final int dstOffset, final public int getMinValue(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1377,7 +1377,7 @@ public int getMinValue(final byte[] dst, final int dstOffset, final int length) public void wrapMinValue(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1391,7 +1391,7 @@ public void wrapMinValue(final DirectBuffer wrapBuffer) public String minValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1474,7 +1474,7 @@ private void onMaxValueAccessed() public int maxValueLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueLengthAccessed(); } @@ -1485,7 +1485,7 @@ public int maxValueLength() public int skipMaxValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1501,7 +1501,7 @@ public int skipMaxValue() public int getMaxValue(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1518,7 +1518,7 @@ public int getMaxValue(final MutableDirectBuffer dst, final int dstOffset, final public int getMaxValue(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1535,7 +1535,7 @@ public int getMaxValue(final byte[] dst, final int dstOffset, final int length) public void wrapMaxValue(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1549,7 +1549,7 @@ public void wrapMaxValue(final DirectBuffer wrapBuffer) public String maxValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1632,7 +1632,7 @@ private void onNullValueAccessed() public int nullValueLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueLengthAccessed(); } @@ -1643,7 +1643,7 @@ public int nullValueLength() public int skipNullValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1659,7 +1659,7 @@ public int skipNullValue() public int getNullValue(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1676,7 +1676,7 @@ public int getNullValue(final MutableDirectBuffer dst, final int dstOffset, fina public int getNullValue(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1693,7 +1693,7 @@ public int getNullValue(final byte[] dst, final int dstOffset, final int length) public void wrapNullValue(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1707,7 +1707,7 @@ public void wrapNullValue(final DirectBuffer wrapBuffer) public String nullValue() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1790,7 +1790,7 @@ private void onCharacterEncodingAccessed() public int characterEncodingLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingLengthAccessed(); } @@ -1801,7 +1801,7 @@ public int characterEncodingLength() public int skipCharacterEncoding() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1817,7 +1817,7 @@ public int skipCharacterEncoding() public int getCharacterEncoding(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1834,7 +1834,7 @@ public int getCharacterEncoding(final MutableDirectBuffer dst, final int dstOffs public int getCharacterEncoding(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1851,7 +1851,7 @@ public int getCharacterEncoding(final byte[] dst, final int dstOffset, final int public void wrapCharacterEncoding(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1865,7 +1865,7 @@ public void wrapCharacterEncoding(final DirectBuffer wrapBuffer) public String characterEncoding() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1948,7 +1948,7 @@ private void onEpochAccessed() public int epochLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochLengthAccessed(); } @@ -1959,7 +1959,7 @@ public int epochLength() public int skipEpoch() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -1975,7 +1975,7 @@ public int skipEpoch() public int getEpoch(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -1992,7 +1992,7 @@ public int getEpoch(final MutableDirectBuffer dst, final int dstOffset, final in public int getEpoch(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -2009,7 +2009,7 @@ public int getEpoch(final byte[] dst, final int dstOffset, final int length) public void wrapEpoch(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -2023,7 +2023,7 @@ public void wrapEpoch(final DirectBuffer wrapBuffer) public String epoch() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -2106,7 +2106,7 @@ private void onTimeUnitAccessed() public int timeUnitLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitLengthAccessed(); } @@ -2117,7 +2117,7 @@ public int timeUnitLength() public int skipTimeUnit() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -2133,7 +2133,7 @@ public int skipTimeUnit() public int getTimeUnit(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -2150,7 +2150,7 @@ public int getTimeUnit(final MutableDirectBuffer dst, final int dstOffset, final public int getTimeUnit(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -2167,7 +2167,7 @@ public int getTimeUnit(final byte[] dst, final int dstOffset, final int length) public void wrapTimeUnit(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -2181,7 +2181,7 @@ public void wrapTimeUnit(final DirectBuffer wrapBuffer) public String timeUnit() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -2264,7 +2264,7 @@ private void onSemanticTypeAccessed() public int semanticTypeLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeLengthAccessed(); } @@ -2275,7 +2275,7 @@ public int semanticTypeLength() public int skipSemanticType() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -2291,7 +2291,7 @@ public int skipSemanticType() public int getSemanticType(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -2308,7 +2308,7 @@ public int getSemanticType(final MutableDirectBuffer dst, final int dstOffset, f public int getSemanticType(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -2325,7 +2325,7 @@ public int getSemanticType(final byte[] dst, final int dstOffset, final int leng public void wrapSemanticType(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -2339,7 +2339,7 @@ public void wrapSemanticType(final DirectBuffer wrapBuffer) public String semanticType() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -2422,7 +2422,7 @@ private void onDescriptionAccessed() public int descriptionLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionLengthAccessed(); } @@ -2433,7 +2433,7 @@ public int descriptionLength() public int skipDescription() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -2449,7 +2449,7 @@ public int skipDescription() public int getDescription(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -2466,7 +2466,7 @@ public int getDescription(final MutableDirectBuffer dst, final int dstOffset, fi public int getDescription(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -2483,7 +2483,7 @@ public int getDescription(final byte[] dst, final int dstOffset, final int lengt public void wrapDescription(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -2497,7 +2497,7 @@ public void wrapDescription(final DirectBuffer wrapBuffer) public String description() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -2580,7 +2580,7 @@ private void onReferencedNameAccessed() public int referencedNameLength() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameLengthAccessed(); } @@ -2591,7 +2591,7 @@ public int referencedNameLength() public int skipReferencedName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2607,7 +2607,7 @@ public int skipReferencedName() public int getReferencedName(final MutableDirectBuffer dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2624,7 +2624,7 @@ public int getReferencedName(final MutableDirectBuffer dst, final int dstOffset, public int getReferencedName(final byte[] dst, final int dstOffset, final int length) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2641,7 +2641,7 @@ public int getReferencedName(final byte[] dst, final int dstOffset, final int le public void wrapReferencedName(final DirectBuffer wrapBuffer) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2655,7 +2655,7 @@ public void wrapReferencedName(final DirectBuffer wrapBuffer) public String referencedName() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java index 4aa64244ca..293377446d 100644 --- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java +++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java @@ -13,8 +13,8 @@ public final class TokenCodecEncoder { private static final boolean ENABLE_BOUNDS_CHECKS = !Boolean.getBoolean("agrona.disable.bounds.checks"); - private static final boolean ENABLE_ACCESS_ORDER_CHECKS = Boolean.parseBoolean(System.getProperty( - "sbe.enable.access.order.checks", + private static final boolean SBE_ENABLE_SEQUENCING_CHECKS = Boolean.parseBoolean(System.getProperty( + "sbe.enable.sequencing.checks", Boolean.toString(ENABLE_BOUNDS_CHECKS))); /** @@ -198,7 +198,7 @@ public TokenCodecEncoder wrap(final MutableDirectBuffer buffer, final int offset this.offset = offset; limit(offset + BLOCK_LENGTH); - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { codecState(CodecStates.V0_BLOCK); } @@ -292,7 +292,7 @@ public static int tokenOffsetMaxValue() public TokenCodecEncoder tokenOffset(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenOffsetAccessed(); } @@ -360,7 +360,7 @@ public static int tokenSizeMaxValue() public TokenCodecEncoder tokenSize(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenSizeAccessed(); } @@ -428,7 +428,7 @@ public static int fieldIdMaxValue() public TokenCodecEncoder fieldId(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onFieldIdAccessed(); } @@ -496,7 +496,7 @@ public static int tokenVersionMaxValue() public TokenCodecEncoder tokenVersion(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTokenVersionAccessed(); } @@ -564,7 +564,7 @@ public static int componentTokenCountMaxValue() public TokenCodecEncoder componentTokenCount(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onComponentTokenCountAccessed(); } @@ -617,7 +617,7 @@ private void onSignalAccessed() public TokenCodecEncoder signal(final SignalCodec value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSignalAccessed(); } @@ -669,7 +669,7 @@ private void onPrimitiveTypeAccessed() public TokenCodecEncoder primitiveType(final PrimitiveTypeCodec value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPrimitiveTypeAccessed(); } @@ -721,7 +721,7 @@ private void onByteOrderAccessed() public TokenCodecEncoder byteOrder(final ByteOrderCodec value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onByteOrderAccessed(); } @@ -773,7 +773,7 @@ private void onPresenceAccessed() public TokenCodecEncoder presence(final PresenceCodec value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onPresenceAccessed(); } @@ -840,7 +840,7 @@ public static int deprecatedMaxValue() public TokenCodecEncoder deprecated(final int value) { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDeprecatedAccessed(); } @@ -897,7 +897,7 @@ public TokenCodecEncoder putName(final DirectBuffer src, final int srcOffset, fi throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -918,7 +918,7 @@ public TokenCodecEncoder putName(final byte[] src, final int srcOffset, final in throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -942,7 +942,7 @@ public TokenCodecEncoder name(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNameAccessed(); } @@ -1003,7 +1003,7 @@ public TokenCodecEncoder putConstValue(final DirectBuffer src, final int srcOffs throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1024,7 +1024,7 @@ public TokenCodecEncoder putConstValue(final byte[] src, final int srcOffset, fi throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1048,7 +1048,7 @@ public TokenCodecEncoder constValue(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onConstValueAccessed(); } @@ -1109,7 +1109,7 @@ public TokenCodecEncoder putMinValue(final DirectBuffer src, final int srcOffset throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1130,7 +1130,7 @@ public TokenCodecEncoder putMinValue(final byte[] src, final int srcOffset, fina throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1154,7 +1154,7 @@ public TokenCodecEncoder minValue(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMinValueAccessed(); } @@ -1215,7 +1215,7 @@ public TokenCodecEncoder putMaxValue(final DirectBuffer src, final int srcOffset throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1236,7 +1236,7 @@ public TokenCodecEncoder putMaxValue(final byte[] src, final int srcOffset, fina throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1260,7 +1260,7 @@ public TokenCodecEncoder maxValue(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onMaxValueAccessed(); } @@ -1321,7 +1321,7 @@ public TokenCodecEncoder putNullValue(final DirectBuffer src, final int srcOffse throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1342,7 +1342,7 @@ public TokenCodecEncoder putNullValue(final byte[] src, final int srcOffset, fin throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1366,7 +1366,7 @@ public TokenCodecEncoder nullValue(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onNullValueAccessed(); } @@ -1427,7 +1427,7 @@ public TokenCodecEncoder putCharacterEncoding(final DirectBuffer src, final int throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1448,7 +1448,7 @@ public TokenCodecEncoder putCharacterEncoding(final byte[] src, final int srcOff throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1472,7 +1472,7 @@ public TokenCodecEncoder characterEncoding(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onCharacterEncodingAccessed(); } @@ -1533,7 +1533,7 @@ public TokenCodecEncoder putEpoch(final DirectBuffer src, final int srcOffset, f throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -1554,7 +1554,7 @@ public TokenCodecEncoder putEpoch(final byte[] src, final int srcOffset, final i throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -1578,7 +1578,7 @@ public TokenCodecEncoder epoch(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onEpochAccessed(); } @@ -1639,7 +1639,7 @@ public TokenCodecEncoder putTimeUnit(final DirectBuffer src, final int srcOffset throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -1660,7 +1660,7 @@ public TokenCodecEncoder putTimeUnit(final byte[] src, final int srcOffset, fina throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -1684,7 +1684,7 @@ public TokenCodecEncoder timeUnit(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onTimeUnitAccessed(); } @@ -1745,7 +1745,7 @@ public TokenCodecEncoder putSemanticType(final DirectBuffer src, final int srcOf throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -1766,7 +1766,7 @@ public TokenCodecEncoder putSemanticType(final byte[] src, final int srcOffset, throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -1790,7 +1790,7 @@ public TokenCodecEncoder semanticType(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onSemanticTypeAccessed(); } @@ -1851,7 +1851,7 @@ public TokenCodecEncoder putDescription(final DirectBuffer src, final int srcOff throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -1872,7 +1872,7 @@ public TokenCodecEncoder putDescription(final byte[] src, final int srcOffset, f throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -1896,7 +1896,7 @@ public TokenCodecEncoder description(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onDescriptionAccessed(); } @@ -1957,7 +1957,7 @@ public TokenCodecEncoder putReferencedName(final DirectBuffer src, final int src throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -1978,7 +1978,7 @@ public TokenCodecEncoder putReferencedName(final byte[] src, final int srcOffset throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2002,7 +2002,7 @@ public TokenCodecEncoder referencedName(final String value) throw new IllegalStateException("length > maxValue for type: " + length); } - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { onReferencedNameAccessed(); } @@ -2041,7 +2041,7 @@ public StringBuilder appendTo(final StringBuilder builder) public void checkEncodingIsComplete() { - if (ENABLE_ACCESS_ORDER_CHECKS) + if (SBE_ENABLE_SEQUENCING_CHECKS) { switch (codecState) { diff --git a/sbe-tool/src/test/cpp/CMakeLists.txt b/sbe-tool/src/test/cpp/CMakeLists.txt index cd92ff756c..0615a5f76e 100644 --- a/sbe-tool/src/test/cpp/CMakeLists.txt +++ b/sbe-tool/src/test/cpp/CMakeLists.txt @@ -90,4 +90,4 @@ sbe_test(CompositeElementsTest codecs) sbe_test(Issue835Test codecs) sbe_test(Issue889Test codecs) sbe_test(FieldAccessOrderCheckTest codecs) -target_compile_definitions(FieldAccessOrderCheckTest PRIVATE ENABLE_ACCESS_ORDER_CHECKS) +target_compile_definitions(FieldAccessOrderCheckTest PRIVATE SBE_ENABLE_SEQUENCING_CHECKS)