Skip to content

Commit f83463a

Browse files
committed
[C++ OTF]: added presence to Ir class for access by OTF decoder internals.
1 parent 9a6f38e commit f83463a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

main/cpp/otf_api/Ir.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ Ir::TokenPrimitiveType Ir::primitiveType() const
152152
return (Ir::TokenPrimitiveType)impl_->tokenCodec.primitiveType();
153153
}
154154

155+
Ir::TokenPresence Ir::presence() const
156+
{
157+
return (Ir::TokenPresence)impl_->tokenCodec.presence();
158+
}
159+
155160
int32_t Ir::schemaId() const
156161
{
157162
return impl_->tokenCodec.schemaId();

main/cpp/otf_api/Ir.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ class Ir
112112
DOUBLE = 11
113113
};
114114

115+
/// Constants used for representing Presence
116+
enum TokenPresence
117+
{
118+
/// Field or encoding presence is required
119+
REQUIRED = 0,
120+
/// Field or encoding presence is optional
121+
OPTIONAL = 1,
122+
/// Field or encoding presence is constant and not encoded
123+
CONSTANT = 2
124+
};
125+
115126
/**
116127
* \brief Interface for returning an Ir for a given templateId value.
117128
*
@@ -179,6 +190,8 @@ class Ir
179190
TokenByteOrder byteOrder() const;
180191
/// Retrieve the Ir::TokenPrimitiveType of the current token
181192
TokenPrimitiveType primitiveType() const;
193+
/// Retrieve the Ir::TokenPresence of the current token
194+
TokenPresence presence() const;
182195
/// Retrieve the ID set by the schema of the current token
183196
int32_t schemaId() const;
184197
/// Return the Ir::VALID_VALUE of an enumeration for the current token

0 commit comments

Comments
 (0)