zerodds-idl-cpp
IDL4 → C++17 and C header codegen for ZeroDDS (OMG IDL4-CPP
formal/2018-07-01 + DDS-PSM-CXX 1.0 + DDS-RPC C++ PSM). Produces
standalone headers that dock onto the runtime via zerodds-c-api.
Part of the ZeroDDS project. Safety class
SAFE (std-only) — forbid(unsafe_code), a build-time tool with no
no_std use case.
Quick Start — C++
use ParserConfig;
use ;
let ast = parse?;
let header = generate_cpp_header?;
assert!;
assert!;
# Ok::
Quick Start — pure C
use ParserConfig;
use ;
let ast = parse?;
let c_header = generate_c_header?;
assert!;
# Ok::
On the CLI, the zerodds-idlc tool exposes the two paths as the
--cpp and --c backends respectively. Output is written as
<basename>.hpp or <basename>.h respectively.
Scope
| Block | What is emitted | Spec |
|---|---|---|
| C5.1-a | Header-Layout, Primitive-Mapping, struct/enum/union/typedef/sequence/array/inheritance, Exception | IDL4-CPP §7 |
| C5.1-b | Status classes (13), QoS policies (22), DCPS entity header stubs | DCPS §7, §8 |
| C5.2 | DDS-PSM-CXX header skeleton layer | DDS-PSM-CXX 1.0 |
| C6.1.D-cpp | DDS-RPC C++ PSM: service interface, Requester, Replier, RemoteException hierarchy | DDS-RPC 1.0 §10 |
| C-Mode | Pure C headers with ZeroDDS conventions | c_mode.rs |
Spec-Mapping
| Spec document | Section |
|---|---|
| OMG IDL 4.2 (ISO/IEC 19516) | §7 — construct mapping |
| OMG IDL4-CPP 1.0 | §7 — header layout |
| OMG DDS-PSM-CXX 1.0 | §3-§5 — entity API |
| OMG DDS-RPC 1.0 | §10 — C++ PSM |
| OMG DDS-XTypes 1.3 | §7.2.3 — annotations + extensibility |
Deliberately NOT in the crate
- Bitset/bitmask, map, fixed, any, interface, valuetype — Phase-2 material.
- Linker tests — static header generation suffices; round-trip tests run in
crates/cpp/tests/.
Features
default = []— std-only, no feature needed.
Stability
1.0.0-rc.2 — wire-byte-identical to Cyclone DDS / RTI Connext /
Fast-DDS. The API may still break in detail points before 1.0.0-final
(options field order, error variants); generated headers stay
ABI-stable.
Tests
Fixture IDLs under tests/fixtures/, snapshot tests per construct.
See also
zerodds-idl— parser + AST (input side).zerodds-cpp— C++17 RAII wrapper, runtime side of the binding.zerodds-c-api— C FFI that binds the headers against the Rust runtime.zerodds-idlc— CLI with--cppand--cflags.packaging/docker/cpp-runtime/— sandbox image with toolchain + headers.