ark::serialization::JsGenerator

Defined in header “ark/serialization/js_generator.hh”.


This generator allows you to take in a generator configuration and then emit all of the necessary Javascript code to automatically serialize/deserialize that schema.

Methods

  • JsGenerator(RbufGeneratorConfiguration config, SchemaRegistry registry)
    Constructor. Initializes the generator for the target type, pulling information from the given registry as needed.

  • std::string source()
    Returns the contents of the generated source file.

  • void emit_field_deserializer(std::stringstream & stream, const FieldDescriptor & field)
    This emits a field deserializer (code to deserialize a particular field).

  • void emit_field_serializer(std::stringstream & stream, const SchemaRegistry & registry, const FieldDescriptor & field)
    This emits a field serializer (code to serialize a particular field).