Skip to content

Commit 1c8bf33

Browse files
committed
[c++] Add bit query on choice set of value via static method. Issue aeron-io#489.
1 parent 7901c90 commit 1c8bf33

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,16 @@ private CharSequence generateChoices(final String bitsetClassName, final List<To
666666

667667
sb.append(String.format(
668668
"\n" +
669+
" static bool %1$s(const %2$s bits)\n" +
670+
" {\n" +
671+
" return %3$s(bits) & (0x1L << %4$s);\n" +
672+
" }\n\n",
673+
choiceName,
674+
typeName,
675+
byteOrderStr,
676+
choiceBitPosition));
677+
678+
sb.append(String.format(
669679
" bool %1$s() const\n" +
670680
" {\n" +
671681
"%2$s" +

0 commit comments

Comments
 (0)