Skip to content

Commit eaf98b6

Browse files
committed
[C++] Add meta attribute PRESENCE to generated codecs. Issue #483.
1 parent 21f212e commit eaf98b6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sbe-tool/src/main/cpp/sbe/sbe.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ enum Attribute
9494
{
9595
EPOCH,
9696
TIME_UNIT,
97-
SEMANTIC_TYPE
97+
SEMANTIC_TYPE,
98+
PRESENCE
9899
};
99100

100101
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,13 +1552,15 @@ private static void generateFieldMetaAttributeMethod(
15521552
indent + " case MetaAttribute::EPOCH: return \"%s\";\n" +
15531553
indent + " case MetaAttribute::TIME_UNIT: return \"%s\";\n" +
15541554
indent + " case MetaAttribute::SEMANTIC_TYPE: return \"%s\";\n" +
1555+
indent + " case MetaAttribute::PRESENCE: return \"%s\";\n" +
15551556
indent + " }\n\n" +
15561557
indent + " return \"\";\n" +
15571558
indent + " }\n",
15581559
token.name(),
15591560
epoch,
15601561
timeUnit,
1561-
semanticType));
1562+
semanticType,
1563+
encoding.presence().toString().toLowerCase()));
15621564
}
15631565

15641566
private static CharSequence generateEnumFieldNotPresentCondition(

0 commit comments

Comments
 (0)