Skip to content

Commit b32b488

Browse files
author
Egor Seredin
committed
[C++] add message function isConstLength()
1 parent cbe0cf2 commit b32b488

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,6 +2926,11 @@ private CharSequence generateMessageLength(
29262926
final StringBuilder sb = new StringBuilder();
29272927

29282928
new Formatter(sb).format("\n" +
2929+
indent + "SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT\n" +
2930+
indent + "{\n" +
2931+
indent + " return " + ((groups.isEmpty() && varData.isEmpty()) ? "true" : "false") + ";\n" +
2932+
indent + "}\n\n" +
2933+
29292934
indent + "SBE_NODISCARD static SBE_CONSTEXPR_14 size_t messageLength(%1$s)\n" +
29302935
indent + "{\n" +
29312936
"#if defined(__GNUG__) && !defined(__clang__)\n" +

0 commit comments

Comments
 (0)