Generator

Details on the ObjectBox Generator tool.

See installation and Generating Binding Code for introductory topics of the Generator.

C++ Standard compliance

The C++ default output mode (using option switch -cpp) generates at least C++14 compliant code currently. If you need to generate C++11 compliant code use -cpp11 instead.

C++ Advanced Options

  • -empty-string-as-null: Empty strings are treated as null values in flatbuffers binary representation.

  • -nan-as-null: NaN (Not-A-Number) float32/float64 values are treated as null values in flatbuffers binary representation.

  • -optional std::optional|std::unique_ptr|std::shared_ptr: C++ wrapper type to use for fields annotated with optional .

Embedded flatc compiler

The ObjectBox Generator is distributed as self-contained portable binary for Linux, Windows and macOS platforms, written in Go. As a goodie it encapsulates a fully functional flatc compiler for generic flatbuffers tooling - comprising over a dozen language bindings. Use the compiler by providing FLATC as first option, passing the rest of arguments to the embedded flatc:

objectbox-generator FLATC <flat arguments>

See all available options via objectbox-generator FLATC --help

Example generic flatbuffers usage:

objectbox-generator FLATC --cpp --rust monster.fbs

Last updated