Skip to content

v0.21.0 — OMG IDL parser + C++ code generator (dds::idl / ddstool)

Choose a tag to compare

@SoundMatt SoundMatt released this 28 Jul 06:22
· 11 commits to main since this release
8113dc7

Added

  • dds::idl (include/dds/idl/idl.hpp, src/idl/parser.cpp, src/idl/gen.cpp) — an OMG IDL lexer/parser plus a C++ code generator, a faithful C++ port of go-DDS's tools/idl package, the third item of ROADMAP.md's "Tier 3 — xtypes, tsn, idl, cdr". Parses module (nestable)/struct/enum/typedef declarations, basic types, bounded/unbounded sequences, bounded strings, fixed-size arrays, qualified Module::Name references, and the @key annotation. Generates a self-contained C++ header: a struct/enum class/using-alias per declaration plus a <Name>Codec built on dds::cdr::Encoder/Decoder (Tier 3, cdr, v0.20.0), with nested-struct inlining and a cycle guard. Two go-DDS quirks independently confirmed against a fresh go-DDS clone and faithfully preserved: the emitted namespace is always idlgen unless the root Module's name is overridden, and a parenthesized annotation argument (@id(5)) is a parse error.
  • ddstool (ddstool/cli.hpp, ddstool/cli.cpp, ddstool/main.cpp) — a new standalone CLI executable exposing ddstool idl [-out <file>] [-namespace <name>] <input.idl>, distinct from the existing cpp-dds RELAY-conformance CLI. Logic lives in a small ddstool_cli static library so it's testable in-process.
  • A checked-in round-trip fixture (tests/idl_roundtrip/schema.idl + schema_gen.hpp, produced by actually running the ddstool binary) mirroring go-DDS's own tools/idl/roundtrip/ package field-for-field. Header/Telemetry marshal() output verified byte-exact against reference vectors independently derived from a fresh go-DDS clone.
  • 101 new tests (tests/test_idl.cpp, tests/test_ddstool_cli.cpp, tests/idl_roundtrip/test_idl_roundtrip.cpp) — 500/500 tests total. Adds REQ-IDL-001 through REQ-IDL-009, traced and tested.

Verified locally: Release C++17 build clean, new files additionally compiled warning-clean under a genuine -std=c++20 invocation, ctest 500/500, Debug ASan+UBSan pass. CI: all 13 checks green (Linux/macOS/Windows matrix, gcc-12 ASan+UBSan, cpp-FuSa full lifecycle).

Full changelog: https://github.com/SoundMatt/cpp-DDS/blob/main/CHANGELOG.md#0210--2026-07-27