@@ -44,10 +44,13 @@ using Schema = std::vector<SchemaTree::Node::id_t>;
4444/* *
4545 * Deserializes the parent ID of a schema tree node.
4646 * @param reader
47- * @return a result containing a pair of an auto-generated ID indicator and a decoded node ID, or an
48- * error code indicating the failure:
49- * - Forwards `deserialize_and_decode_schema_tree_node_id`'s return values.
50- * - Forwards `deserialize_tag`'s return values.
47+ * @return A result containing a pair or an error code indicating the failure:
48+ * - The pair:
49+ * - Whether the node ID is for an auto-generated node.
50+ * - The decoded node ID.
51+ * - The possible error codes:
52+ * - Forwards `deserialize_tag`'s return values.
53+ * @return Forwards `deserialize_and_decode_schema_tree_node_id`'s return values.
5154 */
5255[[nodiscard]] auto deserialize_schema_tree_node_parent_id (ReaderInterface& reader
5356) -> OUTCOME_V2_NAMESPACE::std_result<std::pair<bool, SchemaTree::Node::id_t>>;
@@ -99,6 +102,8 @@ deserialize_int_val(ReaderInterface& reader, encoded_tag_t tag, value_int_t& val
99102 * @param reader
100103 * @param tag Takes the current tag as input and returns the last tag read.
101104 * @return A result containing the deserialized schema or an error code indicating the failure:
105+ * - std::err::protocol_not_supported if the IR stream contains auto-generated keys (TODO: Remove
106+ * this once auto-generated keys are fully supported).
102107 * - Forwards `deserialize_tag`'s return values.
103108 * - Forwards `deserialize_and_decode_schema_tree_node_id`'s return values.
104109 */
@@ -174,7 +179,7 @@ requires(std::is_same_v<ir::four_byte_encoded_variable_t, encoded_variable_t>
174179
175180/* *
176181 * @param tag
177- * @return Whether the given tag represent a valid encoded key ID.
182+ * @return Whether the given tag represents a valid encoded key ID.
178183 */
179184[[nodiscard]] auto is_encoded_key_id_tag (encoded_tag_t tag) -> bool;
180185
@@ -292,6 +297,7 @@ auto deserialize_schema(ReaderInterface& reader, encoded_tag_t& tag)
292297 Schema schema;
293298 while (true ) {
294299 if (false == is_encoded_key_id_tag (tag)) {
300+ // The log event must be an empty value.
295301 break ;
296302 }
297303
@@ -304,7 +310,7 @@ auto deserialize_schema(ReaderInterface& reader, encoded_tag_t& tag)
304310 }
305311 auto const [is_auto_generated, node_id]{schema_tree_node_id_result.value ()};
306312 if (is_auto_generated) {
307- // currently , we don't support auto-generated keys
313+ // Currently , we don't support auto-generated keys.
308314 return std::errc::protocol_not_supported;
309315 }
310316 schema.push_back (node_id);
@@ -470,10 +476,11 @@ auto is_log_event_ir_unit_tag(encoded_tag_t tag) -> bool {
470476
471477auto is_encoded_key_id_tag (encoded_tag_t tag) -> bool {
472478 // Ideally, we could check whether the tag is within the range of
473- // [EncodedKeyIdByte, EncodedKeyIdInt]. There are two reasons why we don't do this:
474- // - We optimize for streams that has few key IDs: we can short circuit in the first branch
475- // - The range check assumes all length indicator to be defined continuously in order
476- // We don't have static checks for this assumption.
479+ // [EncodedKeyIdByte, EncodedKeyIdInt], but we don't for two reasons:
480+ // - We optimize for streams that have few key IDs, meaning we can short circuit in the first
481+ // branch below.
482+ // - Using a range check assumes all length indicators are defined continuously, in order, but
483+ // we don't have static checks for this assumption.
477484 return cProtocol::Payload::EncodedKeyIdByte == tag
478485 || cProtocol::Payload::EncodedKeyIdShort == tag
479486 || cProtocol::Payload::EncodedKeyIdInt == tag;
@@ -517,7 +524,7 @@ auto deserialize_ir_unit_schema_tree_node_insertion(
517524 }
518525 auto const [is_auto_generated, parent_id]{parent_node_id_result.value ()};
519526 if (is_auto_generated) {
520- // currently , we don't support auto-generated keys
527+ // Currently , we don't support auto-generated keys.
521528 return std::errc::protocol_not_supported;
522529 }
523530
0 commit comments