IDL4 to C++ Language Mapping 1.0 — Spec Coverage
Spec: OMG IDL4-CPP 1.0 (101 pages, OMG formal/25-03-03)
Item-by-item audit against the spec; every requirement with its spec
quote, repo path, test path and status (done / partial / open /
n/a).
Context: the C++ column of the IDL transplant lives in four layers today:
crates/lang-rules/src/adapter/cpp.rs· docs.rs — IDL data types (struct, union, enum, bitset, bitmask, typedef, constant, exception, sequence, array, map, string,@optional,@external) to the C++ CST.crates/lang-cst/src/cpp/mod.rs· docs.rs — the C++ CST (escape_keyword,Include,Primitive).crates/lang-render/src/cpp.rs· docs.rs — the renderer.crates/lang-rules/src/emit/interface_cpp.rs· docs.rs — interfaces through the DDS-RPC 1.0 §7.11.1 binding (not the generic §7.4 form).
Hand-written runtime, not generated from this spec:
crates/cpp/include/dds/— the DDS-PSM-Cxx 1.0 API (Time, InstanceHandle, Status, Fixed, Exception, Topic, TopicTraits, Publisher, Subscriber, DomainParticipant).runtime/cpp/include/— the wire runtime (zerodds/wire.hpp,dds/rpc.hpp); the corpus gate compiles against it.
Finding that carries the page: the C++ column emits no omg::types
anywhere. grep -rl "omg::types" crates/ tools/ runtime/ endpoints/
finds exactly one file — crates/corba-codegen/src/traits.rs, a Rust
CORBA generator, not this C++ binding. Every item whose requirement is an
omg::types alias or trait is therefore open or partial.
§1 Scope
1.1 Mapping IDL v4 -> C++
Spec: §1, p. 1 — “This specification defines the mapping of OMG Interface Definition Language v4 to the C++ programming language.”
Repo: —
Tests: —
Status: n/a (informative) — a scope statement of the specification,
with no requirement on an implementation.
§2 Conformance Criteria
2.1 Implementation: IDL -> C++ source per Chapter 7
Spec: §2, p. 1 — “A conformant implementation shall transform IDL input into C++ source code output as specified in Chapter 7.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal,
crates/lang-rules/tests/cpp_corpus_compiles.rs::the_compiler_check_catches_a_deliberate_error
Status: partial — the data-type transformation is live and renders
every corpus case (or names its refusal); the compiler gate checks the
generated headers. Chapter 7 is not fully met: the omg::types runtime
(type traits, Any, fixed, sequence/string aliases) is missing,
§7.4 interfaces run through the DDS-RPC binding rather than the generic
form, and §7.4.1 exceptions and §7.6 valuetypes are shaped differently.
§3 Normative References
3.1 [ISO/IEC-14882] and [OMG-*]
Spec: §3, p. 1-2 — [ISO/IEC-14882:1998/2003/2011/2017], [OMG-C++], [OMG-C++11], [OMG-CORBA-COMP], [OMG-CORBA-IFC], [OMG-IDL4].
Repo: —
Tests: —
Status: n/a (informative) — a reference list; the C++ version is
audited in §7.1.3, the IDL version in §3.9.
§4 Terms and Definitions
4.1 Building Block, C++, Language Mapping
Spec: §4, p. 2 — glossary (Building Block, C++, Language Mapping).
Repo: —
Tests: —
Status: n/a (informative) — definitions without a code requirement.
§5 Symbols
5.1 Acronyms (Tab.5.1)
Spec: §5 Tab.5.1, p. 2-3 — CCM/CORBA/DDS/IDL.
Repo: —
Tests: —
Status: n/a (informative) — abbreviations.
§6 Additional Information
6.1-6.3 Changes, Acknowledgments, Intellectual Property Rights
Spec: §6.1-6.3, p. 3.
Repo: —
Tests: —
Status: n/a (informative) — changes to other specs, acknowledgements, rights notices.
§7.1 General
7.1.1 Names
Spec: §7.1.1, p. 5 — “IDL member names and type identifiers shall map to equivalent C++ names and type identifiers with no change.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::tests::a_sequence_is_a_vector_and_a_map_is_a_class_over_a_vector_of_pairs — crates/lang-rules/src/adapter/cpp.rs:2752: assert!(text.contains("std::vector<std::int32_t> items;"), "{text}");
Status: done — the member name items stays unchanged. The only name
change is the reserved-name escaping of §7.1.2.
7.1.2 Reserved Names
Spec: §7.1.2, p. 5-6 — “The use of any of these names for a user-defined IDL type or interface (assuming it is also a legal IDL name) shall result in the mapped name having an underscore (’_’) prepended.”
Repo: crates/lang-cst/src/cpp/mod.rs (escape_keyword)
Tests: crates/lang-cst/src/cpp/mod.rs::a_keyword_escapes_with_a_trailing_underscore — crates/lang-cst/src/cpp/mod.rs:924: assert_eq!(escape_keyword("class"), "class_");
Status: partial — collisions with C++ keywords are detected and
rewritten, but with a trailing underscore (class -> class_), not
with the leading underscore §7.1.2 mandates (_class). Detection is
complete; the applied mapping deviates.
7.1.3 C++ Language Version Requirements
Spec: §7.1.3, p. 6 — “The language mappings defined in this specification require C++11 [ISO/IEC-14882:2011] as the minimum C++ standard version.”
Repo: crates/lang-rules/tests/cpp_corpus_compiles.rs
Tests: crates/lang-rules/tests/cpp_corpus_compiles.rs::every_corpus_case_that_renders_also_compiles — crates/lang-rules/tests/cpp_corpus_compiles.rs:159: .args(["-std=c++20", "-fsyntax-only", "-Wall", "-Wextra", "-Werror"])
Status: done — the corpus is syntax-checked under -std=c++20; that
meets the C++11 minimum and covers the C++17 constructs actually used
(std::optional, inline constexpr). The corpus test is #[ignore] and
runs with --include-ignored.
7.1.4 IDL Type Traits (Tab.7.1 and Tab.7.4-7.12)
Spec: §7.1.4 Tab.7.1, p. 6-7 — “Type traits shall be available under
the omg::types namespace” (value_type, in_type, out_type,
inout_type, _t/_v aliases); plus the specialisations Tab.7.4
(sequences), Tab.7.5 (strings), Tab.7.6 (wstrings), Tab.7.7 (digits,
scale), Tab.7.8 (bit_bound, underlying_type), Tab.7.9
(dimensions), Tab.7.10/7.11 (is_bounded, bound, key, elements)
and Tab.7.12 (bit_bound, underlying_type).
Repo: —
Tests: —
Status: open — no omg::types namespace. grep -rl "omg::types" crates/ tools/ runtime/ endpoints/ finds only
crates/corba-codegen/src/traits.rs (a Rust CORBA generator). The C++
column writes std:: types directly; no trait of Tables 7.1 and 7.4-7.12
is emitted.
§7.2 Core Data Types
7.2.1 IDL Specification
Spec: §7.2.1, p. 7 — “There is no direct mapping of the IDL Specification itself.”
Repo: —
Tests: —
Status: n/a (informative) — “There is no direct mapping of the IDL Specification itself.”
7.2.2 Modules
Spec: §7.2.2, p. 7 — “IDL modules shall be mapped to C++ namespaces of the same name. […] IDL declarations not enclosed in any module shall be mapped into the global scope.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::a_module_is_a_namespace_and_not_a_prefix — crates/lang-rules/src/adapter/cpp.rs:1987: assert!(text.contains("namespace a {"), "{text}");
Status: done — modules become namespace blocks, references are
written from the root scope (::a::P), no a_b_P prefix.
7.2.3 Constants
Spec: §7.2.3, p. 7-8 — “IDL constants of numeric and boolean types shall be mapped to C++ constexpr declarations […] IDL constants of string type shall be mapped to a constexpr declaration of omg::types::string_view type […] of wstring type […] omg::types::wstring_view […] The constant value of wide character and wide string constants shall be preceded by L.”
Repo: crates/lang-rules/src/adapter/cpp.rs (constant loop,
cpp_constant)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — numeric and boolean constants are emitted as
inline constexpr. String, wstring and fixed constants are emitted as
const char *, not as constexpr omg::types::string_view or
std::string_view; the L prefix for wide literals is missing because
wstring is held as UTF-8. No assertion covers the constant form
directly.
§7.2.4 Data Types
7.2.4.1 Basic Types (Tab.7.2/7.3)
Spec: §7.2.4.1.1-§7.2.4.1.6, p. 8-9 — integers (Tab.7.2), floating point (Tab.7.3), char, wchar, boolean, octet.
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses,
crates/lang-rules/src/adapter/cpp.rs::an_array_nests_with_the_outer_dimension_outermost
Status: partial — long -> std::int32_t is asserted (array,
interface and verbatim tests), and octet/uint8 as well as wchar/
unsigned short collapse onto one type (tag test). The remaining table
widths (short -> int16_t, long long -> int64_t, char, wchar,
boolean, octet, float) have no assertion of their own. long double
is mapped to zerodds::wire::Float128 instead of the C++ long double
(§7.2.4.1.2, own item). cpp_primitive is
exhaustive, so a missing primitive is a compile error.
7.2.4.1.2 long double -> long double
Spec: §7.2.4.1.2, Tab.7.3, p. 8 — “long double | long double”.
Repo: —
Tests: —
Status: open — cpp_primitive (crates/lang-rules/src/adapter/cpp.rs) maps long double to zerodds::wire::Float128.
7.2.4.2.1 Sequences -> std::vector
Spec: §7.2.4.2.1, p. 9 — “IDL sequences shall be mapped to a C++
std::vector
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type, sequence
arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::tests::a_sequence_is_a_vector_and_a_map_is_a_class_over_a_vector_of_pairs — crates/lang-rules/src/adapter/cpp.rs:2752: assert!(text.contains("std::vector<std::int32_t> items;"), "{text}");
Status: done — std::vector<T> is one of the forms §7.2.4.2.1 allows
(the omg::types::sequence alternative is audited in §7.1.4).
7.2.4.2.1 omg::types::sequence/bounded_sequence
Spec: §7.2.4.2.1 Tab.7.4, p. 9 — “implementers shall always define
omg::types::sequence
Repo: —
Tests: —
Status: open — neither omg::types::sequence<T> nor
omg::types::bounded_sequence<T,N> nor the is_bounded/bound
specialisations exist.
7.2.4.2.2 Strings -> std::string
Spec: §7.2.4.2.2, p. 10 — “IDL strings shall be mapped to C++ std::string, or to a type named omg::types::string.”
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type, string
arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — string is held as std::string (an allowed
form). There is no direct assertion for the data member (only the tag
test shows that string and wstring fall onto the same C++ type);
omg::types::string is missing.
7.2.4.2.2 omg::types::string/bounded_string
Spec: §7.2.4.2.2 Tab.7.5, p. 10 — “implementers shall always define
omg::types::string […] omg::types::bounded_string
Repo: —
Tests: —
Status: open — no omg::types::string/bounded_string<N> aliases,
no is_bounded/bound traits.
7.2.4.2.3 Wstrings
Spec: §7.2.4.2.3, p. 11 — “IDL wstrings shall be mapped to C++ std::wstrings, or to a type named omg::types::wstring […].”
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — wstring is held as std::string with UTF-8, not
as std::wstring and not as omg::types::wstring; the spec form is not
met. No direct assertion.
7.2.4.2.3 omg::types::wstring/bounded_wstring
Spec: §7.2.4.2.3 Tab.7.6, p. 11 — “omg::types::wstring […]
omg::types::bounded_wstring
Repo: —
Tests: —
Status: open — no omg::types::wstring/bounded_wstring<N>, no
traits.
7.2.4.2.4 Fixed Type
Spec: §7.2.4.2.4, p. 11-12 — “The IDL fixed type shall map to a C++
class named fixed […] under the omg::types namespace” (about 30 methods
plus free functions and the digits/scale traits Tab.7.7).
Repo: —
Tests: —
Status: open — the data-type column maps fixed<P,S> to std::string
in crates/lang-rules/src/adapter/cpp.rs. The hand-written
dds::core::Fixed<P,S> in crates/cpp/include/dds/core/Fixed.hpp is the
DDS-PSM-Cxx runtime (a different spec) and offers only BCD round-trip plus
string conversion, not the ~30 spec methods; omg::types::fixed and the
digits/scale traits are missing.
7.2.4.3.1 Structures
Spec: §7.2.4.3.1, p. 13 — “An IDL struct shall be mapped to a C++ struct […] default constructor […] copy constructor […] move constructor […] copy assignment […] move assignment […] comparison operators, including at least ‘equal to’ and ‘not equal to’ […] destructor […] swap function in the namespace.”
Repo: crates/lang-rules/src/adapter/cpp_psm.rs (class with accessors, ==, !=, swap), crates/lang-rules/src/adapter/cpp.rs (structure branch)
Tests: crates/cpp/tests/generated_type_via_cargo.rs::a_psm_mapped_type_round_trips_through_the_dds_psm_writer_and_reader (crates/cpp/tests/generated_psm_roundtrip.cpp: constructors, copy, move, swap, equality)
Status: done — the default mapping (--cpp-mapping psm) writes a class with the accessors, the constructor over all members, ==, != and swap in the namespace (§7.12); copy and move are the implicit functions. The option native writes the structure of the codecs with public members, swap and, for pointer members, the generated copy and move functions, but no ==. Log: .agent/REPORT.md.
7.2.4.3.1 Default initialization
Spec: §7.2.4.3.1, p. 13 — “A default constructor that initializes all built-in data types to their default value […] enumerators to their first value, and the rest of members using their default constructor.”
Repo: crates/lang-rules/src/adapter/cpp.rs (member_default)
Tests: tools/idlc/tests/cpp_headers_together.rs::two_generated_headers_share_a_translation_unit_and_their_structs_start_at_their_defaults — tools/idlc/tests/cpp_headers_together.rs:126: status.success(),
Status: done — the test compiles and runs default-constructed
structs; the exit code is non-zero if a built-in is not 0, bool is not
false, double is not 0.0, the enum is not its first literal, or an
array/sequence is not empty.
7.2.4.3.2 Unions
Spec: §7.2.4.3.2, p. 14-15 — class with _d() const/void _d(T),
member accessor/modifier per branch, multi-label modifier with a
discriminator parameter, and _default().
Repo: crates/lang-rules/src/adapter/cpp.rs (union arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::a_union_is_a_class_with_a_discriminator_and_one_field_per_case
Status: partial — the union is emitted as a class with a _d field
and one field per branch (asserted: struct U {, std::int32_t _d;).
The required accessor/modifier methods, the multi-label variant and
_default() are missing; the branches are public fields.
7.2.4.3.3 Enumerations
Spec: §7.2.4.3.3, p. 16 — “An IDL enum shall be mapped to a C++ scoped enum class with the same name as the IDL enum type.”
Repo: crates/lang-rules/src/adapter/cpp.rs (enumeration arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound — crates/lang-rules/src/adapter/cpp.rs:2050: assert!(narrow.contains("enum class E : std::uint8_t {"), "{narrow}");
Status: done — a scoped enum class with the same name; the
underlying type is chosen from @bit_bound and the enumerator values.
7.2.4.3.3 Enumeration Type Traits
Spec: §7.2.4.3.3 Tab.7.8, p. 17 — “bit_bound […] underlying_type.”
Repo: —
Tests: —
Status: open — the bit_bound/underlying_type specialisations are
not emitted (see §7.1.4).
7.2.4.3.4 Constructed Recursive Types
Spec: §7.2.4.3.4, p. 16 — “Constructed recursive types are supported by mapping the involved types directly to C++.”
Repo: crates/lang-rules/src/adapter/cpp.rs (forward declarations,
sequence/shared_ptr arms)
Tests: crates/lang-rules/tests/external_is_an_indirection.rs::a_recursive_external_member_is_a_shared_pointer_and_not_a_value
Status: partial — forward declarations for aggregates and
std::vector<T>/std::shared_ptr<T> allow self-reference; only the
@external recursion case is evidenced (std::shared_ptr<::m::Node> next;). The general case (self-reference through sequence<Node> without
@external) has no assertion of its own.
7.2.4.4 Arrays
Spec: §7.2.4.4, p. 17 — “An IDL array shall be mapped to a C++ std::array of the mapped element type, or to a type named omg::types::array […] Multidimensional arrays shall be constructed nesting std::array.”
Repo: crates/lang-rules/src/adapter/cpp.rs (array arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_array_nests_with_the_outer_dimension_outermost — crates/lang-rules/src/adapter/cpp.rs:2023: assert!(text.contains("std::array<std::array<std::int32_t, 3>, 2> a = {};"), "{text}");
Status: done — std::array, multidimensional, nested
outermost-first; one of the forms §7.2.4.4 allows.
7.2.4.4 omg::types::array and dimensions
Spec: §7.2.4.4 Tab.7.9, p. 17 — “omg::types::array […] dimensions.”
Repo: —
Tests: —
Status: open — omg::types::array and the dimensions trait are
missing.
7.2.4.5 Native Types
Spec: §7.2.4.5, p. 17 — “This language mapping specification does not define any native types, but compliant implementations may provide the necessary mechanisms.”
Repo: —
Tests: —
Status: n/a (informative) — the spec defines no native types; the
adapter optionally maps native to void * or a facet name.
7.2.4.6 Naming Data Types
Spec: §7.2.4.6, p. 17 — “IDL typedefs shall be mapped to type alias declarations.”
Repo: crates/lang-rules/src/adapter/cpp.rs (alias arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — typedef is emitted as a cpp::Alias (C++ using);
no assertion checks the alias declaration directly, and the corpus
compile does not distinguish an alias form from a macro form.
§7.3 Any
7.3 Any -> omg::types::Any
Spec: §7.3, p. 18 — “The IDL any type shall be mapped to a C++ omg::types::Any type.”
Repo: —
Tests: —
Status: open — any is refused in
crates/lang-rules/src/adapter/cpp.rs (cpp_value_type,
TypeKind::Any) with NoLanguageForm (test
an_any_member_is_refused_by_name_at_any_depth, also for
sequence<any>). No omg::types::Any.
§7.4 Interfaces – Basic
7.4 Interfaces -> C++ classes
Spec: §7.4, p. 18-19 — “Each IDL interface shall be mapped to a C++
class […] Each attribute […] pair of pure virtual methods […] Each
operation […] pure virtual method […] IDL out and inout arguments
shall be passed by reference […] in arguments […] by value […] and
as a reference to const otherwise. Parameters of interface type T shall
be mapped to std::shared_ptr
Repo: crates/lang-rules/src/emit/interface_cpp.rs
Tests: crates/lang-rules/tests/interface_bindings.rs::cpp_declares_the_synchronous_operations_of_rule_six,
crates/lang-rules/tests/interface_bindings.rs::cpp_names_an_attribute_accessor_after_the_attribute
Status: partial — interfaces are emitted through the DDS-RPC 1.0
§7.11.1 binding as classes with pure-virtual operations and attribute
accessors (asserted: in by value/const ref, out/inout by reference,
accessor named after the attribute). The binding follows DDS-RPC 1.0 and
adds IAsync/Requester/Replier/Client/Service, which §7.4 does
not know; omg::types::ref_type<T>/weak_ref_type<T> for interface
parameters are missing.
7.4.1 Exceptions
Spec: §7.4.1, p. 19-20 — “An IDL exception shall be mapped to a C++ class […] shall extend the std::exception class […] copy constructor, move constructor, assignment operator, move operator, and destructor […] what() method […] explicit constructor with one parameter for each exception member […] and a parameter of type const char *.”
Repo: crates/lang-rules/src/adapter/cpp.rs (exception loop)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — an IDL exception is emitted as a struct with its
members. The required class X : public std::exception derivation,
what(), copy/move constructor, assignment operators and the explicit
(member..., const char* what) constructor are entirely missing.
7.4.2 Interface Forward Declaration
Spec: §7.4.2, p. 20 — “An IDL interface forward declaration shall be mapped to a partial forward declaration in C++.”
Repo: —
Tests: —
Status: open — interface forward declarations are not emitted; the
data-type adapter writes Forward only for Structure, Union and
Valuetype. interface Foo; without a definition is refused by
crates/lang-rules/src/adapter/interface.rs as ForwardWithoutDefinition
(test
crates/lang-rules/tests/interface_bindings.rs::a_forward_declaration_without_a_definition_is_e002).
§7.5 Interfaces – Full
7.5 Embedded declarations and static constexpr
Spec: §7.5, p. 20 — “adding to mapped class the declaration every type, exception, or constant declaration in the IDL interface body. […] constexpr declarations shall be marked as static.”
Repo: —
Tests: —
Status: open — the DDS-RPC binding in
crates/lang-rules/src/emit/interface_cpp.rs emits topic types and
operation classes, but no nested type/exception/constant declarations
inside the interface body and no static constexpr inside the class.
§7.6 Value Types
7.6 Valuetype -> abstract class
Spec: §7.6, p. 21 — public/private state members -> public/protected
pure-virtual accessor and modifier methods; factory operations ->
<ValueTypeName>_factory; inheritance via public virtual; supports
interface -> all operations as pure virtual.
Repo: crates/lang-rules/src/adapter/cpp.rs (valuetype arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — valuetype is treated like a struct: its members
become fields. The required public/protected pure-virtual accessor/modifier
methods, the <ValueTypeName>_factory class, the public-virtual
inheritance and the operations of a supported interface are missing.
§7.7-§7.13 CORBA, Components and Template Modules
7.7/7.8 CORBA-Specific Interfaces and Value Types
Spec: §7.7-7.8, p. 22 — refers to Annex A.1.
Repo: —
Tests: —
Status: n/a (informative) — the clause itself defines no mapping;
Annex A.1 is audited separately.
7.9/7.10 Components – Basic and Homes
Spec: §7.9-7.10, p. 22 — “mapped to equivalent IDL, as specified in [OMG-CORBA-COMP].”
Repo: —
Tests: —
Status: open — the transformation into equivalent IDL exists (crates/ccm/src/transform.rs, tests in crates/ccm/tests/equivalent_idl.rs), the C++ path of zerodds-idlc does not apply it: tools/idlc and crates/lang-rules do not depend on zerodds-ccm.
7.11 CCM-Specific
Spec: §7.11, p. 22 — refers to Annex A.1.
Repo: —
Tests: —
Status: n/a (informative) — reference to Annex A.1.
7.12/7.13 Components – Ports/Connectors and Template Modules
Spec: §7.12-7.13, p. 22 — “mapped to intermediate IDL, as specified in [OMG-IDL4].”
Repo: crates/idl-lower/src/lower.rs (template_module_inst)
Tests: crates/idl-lower/tests/dialects.rs::an_instantiation_lowers_the_body_with_the_actual_substituted, crates/idl-lower/tests/dialects.rs::two_instantiations_of_one_template_are_two_independent_modules
Status: partial — an instantiation of a template module becomes an ordinary module in the model, which the C++ column maps. Ports and connectors are not translated into intermediate IDL; own item.
7.12 Ports and connectors as intermediate IDL
Spec: §7.12, p. 22 — ports and connectors are “mapped to intermediate IDL, as specified in [OMG-IDL4]”.
Repo: —
Tests: —
Status: open — the C++ column does not translate porttype, port, mirrorport and connector into intermediate IDL.
§7.14 Extended Data Types
7.14.1 Structures with Single Inheritance
Spec: §7.14.1, p. 23 — “shall inherit from the mapped base struct using public inheritance. […] swap method […] which shall ensure that all inherited members are swapped.”
Repo: crates/lang-rules/src/adapter/cpp.rs (all_members_of)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — base members are copied flat into the derived
struct (all_members_of), not as struct Child : Base with public
inheritance; the swap function for inherited members is missing. The
flat form keeps the member order of the wire plan; own item.
7.14.1 Public inheritance and swap of the inherited members
Spec: §7.14.1, p. 23 — “shall inherit from the mapped base struct using public inheritance. […] swap method […] which shall ensure that all inherited members are swapped.”
Repo: —
Tests: —
Status: open — all_members_of (crates/lang-rules/src/adapter/cpp.rs) copies the base members flat into the derived structure; no base class, no swap for inherited members.
7.14.2 Union Discriminators
Spec: §7.14.2, p. 23 — “adds the wchar, and octet IDL types to the set of valid types for a discriminator. […] int8 and uint8 are valid union discriminators.”
Repo: crates/lang-rules/src/adapter/cpp.rs (union arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::a_union_is_a_class_with_a_discriminator_and_one_field_per_case
Status: partial — the discriminator runs through cpp_value_type and
accepts any integral type; only switch (long) is asserted. wchar,
octet, int8 and uint8 as discriminators have no assertion of their
own.
7.14.3.1 Maps
Spec: §7.14.3.1, p. 23-24 — “IDL maps shall be mapped to a C++ std::map<Key,T> […] or to a type named omg::types::map<Key,T> […] omg::types::bounded_map<Key, T, N>.”
Repo: crates/lang-rules/src/adapter/cpp_psm.rs (map branch)
Tests: crates/cpp/tests/generated_type_via_cargo.rs::a_psm_mapped_type_round_trips_through_the_dds_psm_writer_and_reader
Status: done — in the default mapping (psm) map<K,V> is std::map<K,V>; --cpp-mapping native and classic are named options (zerodds::Map, the order of the entries as an axis of the codec). There is no omg::types::map or bounded_map; the spec admits std::map alone. Log: .agent/REPORT.md.
7.14.3.1 Map Type Traits
Spec: §7.14.3.1 Tab.7.10/7.11, p. 24 — “is_bounded […] bound […] key […] elements.”
Repo: —
Tests: —
Status: open — no omg::types::map/bounded_map and none of the
four traits.
7.14.3.2 Bitsets
Spec: §7.14.3.2, p. 24-25 — “IDL bitset types shall be mapped to C++ structs that meet the C++ requirements for aggregate initialization. The only members of these structs are bit fields. […] shall derive (using public inheritance) from the struct resulting from mapping the base type.”
Repo: crates/lang-rules/src/adapter/cpp.rs (bitset arm)
Tests: crates/lang-rules/tests/cpp_reader_generates.rs::every_kind_table_9_answers_for_gets_a_defaulter
Status: partial — bitsets are emitted as a struct with separate integer members, packed in the codec, not as C++ bit-fields; base bit-fields are folded in flat, not through public inheritance. The spec requires bit-fields as the only members.
7.14.3.3 Bitmask Type
Spec: §7.14.3.3, p. 25-26 — “struct type containing […] unscoped enum named _flags […] private member named _value […] default constructor and a copy constructor […] !=, &=, and ^= bitwise operators […] function call operator that returns _value.”
Repo: crates/lang-rules/src/adapter/cpp.rs (bitmask arm)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — a bitmask is emitted as an integer alias
(uint8/16/32/64) plus inline constexpr bit constants, not as a struct
with an unscoped _flags enum, a private _value, constructors,
!=/&=/^= operators and a call operator. The
bit_bound/underlying_type traits are missing.
7.14.4 8-bit Integer Types (Tab.7.13)
Spec: §7.14.4 Tab.7.13, p. 26 — “int8 -> int8_t; uint8 -> uint8_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — octet/uint8 fall onto the same std::uint8_t
(tag test). int8 -> std::int8_t has no assertion of its own.
7.14.5 Explicitly-Named Integer Types (Tab.7.14)
Spec: §7.14.5 Tab.7.14, p. 26-27 — “int16/uint16/int32/uint32/int64/uint64 -> int16_t/uint16_t/int32_t/uint32_t/int64_t/uint64_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — the explicit widths are mapped in cpp_primitive,
but no assertion names int16/uint16/int32/uint32/int64/uint64
individually.
§7.15 Anonymous Types
7.15 Anonymous Types
Spec: §7.15, p. 27 — “No impact to the C++ language mapping.”
Repo: —
Tests: —
Status: n/a (informative) — no mapping impact.
§7.16 User-Defined Annotations
7.16 User-Defined Annotations
Spec: §7.16, p. 27 — “User-defined annotations are not propagated to the generated C++ code.”
Repo: —
Tests: —
Status: n/a (informative) — the C++ column carries no user
annotations into its output; the clause imposes no emission requirement.
§7.17 Standardized Annotations
7.17.1 General Purpose: @optional
Spec: §7.17.1 Tab.7.15, p. 27 — “IDL elements annotated with
@optional of type T shall map to std::optional
Repo: —
Tests: —
Status: open — no mapping writes std::optional<T>: the default mapping (psm) writes dds::core::optional<T> (DDS-PSM-Cxx), the option native a pointer T * (DDS-XTypes 1.3 §7.5.1.2.4.2), the option classic zerodds::classic::Optional<T>. The form of IDL4 to C++ 1.0 §7.17.1 is missing as a named option. Evidence of the forms that exist: crates/lang-rules/src/adapter/cpp_psm.rs (dds::core::optional<T>), crates/lang-rules/src/adapter/cpp.rs (T *), crates/lang-rules/src/adapter/cpp_classic.rs (zerodds::classic::Optional<T>); tests crates/lang-rules/src/adapter/cpp.rs::tests::an_optional_member_is_a_plain_pointer_and_not_a_second_field, crates/cpp/tests/generated_psm_roundtrip.cpp.
7.17.1 General Purpose: @value, @position, @id, @autoid, @extensibility
Spec: §7.17.1 Tab.7.15, p. 27-28 — @value provides the enumerator
value; @position affects the bitmask; @id, @autoid,
@extensibility, @final, @mutable, @appendable have no impact.
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound
Status: partial — @value reaches the enumerator value (the adapter
writes every value out) but is not asserted directly; @position hangs
on the bitmask, which is itself partial (§7.14.3.3); @id, @autoid,
@extensibility, @final, @mutable and @appendable are, as the spec
intends, not carried into the C++.
7.17.2 Data Modeling: @key, @must_understand, @default_literal
Spec: §7.17.2 Tab.7.16, p. 28 — @key/@must_understand have no
impact; “The C++ element declared as result of the mappings […] shall
be initialized to the element indicated by [@default_literal].”
Repo: crates/lang-rules/src/adapter/cpp.rs (member_default)
Tests: tools/idlc/tests/cpp_headers_together.rs::two_generated_headers_share_a_translation_unit_and_their_structs_start_at_their_defaults
Status: partial — @key and @must_understand have no impact, as
the spec says. @default_literal is not evaluated: the member default
takes the first enumerator, not the one marked @default_literal.
7.17.3 Units and Ranges: @default, @range, @min, @max, @unit
Spec: §7.17.3 Tab.7.17, p. 28-29 — @range -> omg::types::ranged<T, min, max> with std::out_of_range; @min/@max -> setters throw
std::out_of_range; @unit no impact; @default initialises.
Repo: —
Tests: —
Status: open — no omg::types::ranged<T,min,max>, no setters (the
data members are public fields) and therefore no std::out_of_range
check for @range/@min/@max. @default is evaluated in the codec
defaulter (crates/lang-rules/src/default_cpp.rs), but not as the C++
member initialiser of the generated struct.
7.17.4 Data Implementation: @bit_bound
Spec: §7.17.4 Tab.7.18, p. 29-30 — “int8_t, for bit bound values between 1 and 8; int16_t […] int32_t […] int64_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (enum_underlying,
cpp_holder)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound
Status: partial — for enums the underlying type is asserted; for bitmasks the adapter follows the same width rule, but the bitmask mapping is itself partial (§7.14.3.3).
7.17.4 Data Implementation: @external
Spec: §7.17.4 Tab.7.18, p. 29-30 — “mapped to std::shared_ptr
Repo: crates/lang-rules/src/adapter/cpp.rs (held_externally,
shared_ptr arms)
Tests: crates/lang-rules/tests/external_is_an_indirection.rs::a_recursive_external_member_is_a_shared_pointer_and_not_a_value — crates/lang-rules/tests/external_is_an_indirection.rs:118: generated.contains("std::shared_ptr<::m::Node> next;"),
Status: partial — @external T is held as std::shared_ptr<T>
(asserted). The required deep copy in the copy constructor is missing:
the compiler-generated copy constructor copies the shared_ptr shallowly,
so the object is shared.
7.17.4 Data Implementation: @nested
Spec: §7.17.4 Tab.7.18, p. 29-30 — “No impact on the language mapping.”
Repo: —
Tests: —
Status: n/a (informative) — no mapping impact.
7.17.5 Code Generation: @verbatim
Spec: §7.17.5 Tab.7.19, p. 30 — “Copies verbatim text to the indicated output position when the indicated language is ’*‘, ’c++’, ‘cpp’, ‘cc’, or ‘cxx’.”
Repo: crates/lang-rules/src/verbatim.rs,
crates/lang-rules/src/adapter/cpp.rs (weave_verbatim)
Tests: crates/lang-rules/tests/verbatim_end_to_end.rs::cpp_answers_to_its_alias_spellings_case_insensitively — crates/lang-rules/tests/verbatim_end_to_end.rs:150: generated.contains("// vb-alias"),
Status: partial — all six placements (BEGIN_FILE,
BEFORE/BEGIN/END/AFTER_DECLARATION, END_FILE) and the languages c++,
cpp, cxx as well as * are live (asserted). cc — explicitly named
in Tab.7.19 — is missing from verbatim::aliases::CPP
(&["c++", "cpp", "cxx"]).
7.17.6 Interfaces: @service, @oneway, @ami
Spec: §7.17.6 Tab.7.20, p. 30 — “Options are ‘CORBA’, ‘DDS’, ’*’. Impact is platform-specific.”
Repo: crates/lang-rules/src/emit/interface_cpp.rs
Tests: crates/lang-rules/tests/interface_bindings.rs::cpp_declares_the_asynchronous_operations_of_rule_seven
Status: partial — @oneway (no reply topic, future<void> async) and
@service (service name) are handled through the DDS-RPC binding; @ami
has no path of its own. Tab.7.20 explicitly calls the impact
platform-specific.
§8 IDL to C++ Language Mapping Annotations
8.1 @cpp_mapping Annotation
Spec: §8.1, p. 31 — “enum StructMapping { STRUCT_WITH_PUBLIC_MEMBERS, CLASS_WITH_PUBLIC_ACCESSORS_AND_MODIFIERS }; StructMapping struct_mapping default STRUCT_WITH_PUBLIC_MEMBERS.”
Repo: —
Tests: —
Status: open — the annotation is not evaluated; the form of structures is chosen by the option --cpp-mapping per run (default psm: a class with accessors), not by @cpp_mapping per structure, and the default value of the annotation is STRUCT_WITH_PUBLIC_MEMBERS.
8.1.1 CLASS_WITH_PUBLIC_ACCESSORS_AND_MODIFIERS
Spec: §8.1.1, p. 31-32 — “mapping the annotated IDL struct to C++ class where all members are only accessible via public accessor methods, and may only be modified through public modifier methods.”
Repo: —
Tests: —
Status: open — no path emits the annotated struct as a class with
private members, accessors/modifiers and an initialising constructor.
@cpp_mapping is not read by crates/lang-rules/src/adapter/cpp.rs.
Annex A: Platform-Specific Mappings
A.1 CORBA-Specific Mappings
Spec: Annex A.1, p. 33-66 — CORBA::traits<> (value_type,
in_type, out_type, inout_type, tables A.1-A.15),
CORBA::servant_traits<>, TypeCode, ORB, Object, Any, Value Types,
Abstract Interfaces, Server Side Mapping, DSI, PortableServer.
Repo: —
Tests: —
Status: open — no CORBA::traits<>/CORBA::servant_traits<> in the
C++ column and no omg::types. crates/corba-codegen/src/traits.rs is a
Rust CORBA generator, not this C++ binding.
A.2 DDS-Specific Mappings
Spec: Annex A.2, p. 66 — “DDS requires no additional platform-specific language mappings.”
Repo: —
Tests: —
Status: n/a (informative) — the spec requires no additional
DDS-specific C++ mapping.
Annex B: Building Block Traceability Matrix
Spec: Annex B (non-normative), p. 67.
Repo: —
Tests: —
Status: n/a (informative) — Annex B is “non-normative”.
Annex C: Compatibility Rules for C++98 and C++03
Spec: Annex C (normative), p. 69-77 — alternative mappings for C++98 and C++03.
Repo: —
Tests: —
Status: open — an optional mapping; the PSM column (--cpp-mapping psm) targets C++17 (§7.1.3) and has no form for C++98 or C++03.
Annex D: IDL4 Mapping Rules for Classic C++ Mapping Specifications
Spec: Annex D, p. 79-89 — mappings for the classic C++ and C++11 specs.
Repo: crates/lang-rules/src/adapter/cpp_classic.rs (CppMapping::Classic), runtime/cpp/include/zerodds/map.hpp (zerodds::Map)
Tests: tools/idlc/tests/cpp_classic.rs::the_classic_types_are_cpp03_and_the_codec_writes_the_native_bytes
Status: partial — ZeroDDS has a classic mapping per [OMG-C++] (--cpp-mapping classic, C++03), to which Annex D applies. The map class does not follow D.2.1.3.1 (own item); the other rules of D.2 are not checked one by one against the mapping. D.3 concerns the C++11 mapping [OMG-C++11], which ZeroDDS does not have.
Annex D.2.1.3.1 Maps in the classic mapping
Spec: Annex D.2.1.3.1, p. 80 — a map becomes a C++ class with a default constructor, operator[], ULong maximum() const, ULong length() const, void clear(), Boolean insert(const K&, const T&, Boolean replace = TRUE), Boolean insert_or_assign(const K&, const T&) and Boolean erase(const K&).
Repo: —
Tests: —
Status: open — zerodds::Map (runtime/cpp/include/zerodds/map.hpp) has get_size, get_max_size, set_max_size, insert and erase with DDS::ReturnCode_t, but not maximum(), length(), clear(), insert_or_assign and the returns as Boolean.
Audit Status
9 done / 26 partial / 22 open / 0 blocked / 14 n/a (informative).
Open items: idl4-cpp-1.0.open.en.md.
IDL4 to C++ Language Mapping 1.0 — Spec-Coverage
Spec: OMG IDL4-CPP 1.0 (101 Seiten, OMG formal/25-03-03)
Item-für-Item-Audit gegen die Spec; jede Anforderung mit Spec-Zitat,
Repo-Pfad, Test-Pfad und Status (done / partial / open / n/a).
Kontext: Die C++-Spalte des IDL-Transplantats lebt heute in vier Schichten:
crates/lang-rules/src/adapter/cpp.rs· docs.rs — IDL-Datentypen (Struct, Union, Enum, Bitset, Bitmask, Typedef, Konstante, Exception, Sequenz, Array, Map, String,@optional,@external) nach C++-CST.crates/lang-cst/src/cpp/mod.rs· docs.rs — der C++-CST (escape_keyword,Include,Primitive).crates/lang-render/src/cpp.rs· docs.rs — der Renderer.crates/lang-rules/src/emit/interface_cpp.rs· docs.rs — Interfaces über die DDS-RPC-1.0-§7.11.1-Bindung (nicht die generische §7.4-Form).
Handgeschriebene Laufzeit, nicht aus dieser Spec erzeugt:
crates/cpp/include/dds/— DDS-PSM-Cxx-1.0-API (Time, InstanceHandle, Status, Fixed, Exception, Topic, TopicTraits, Publisher, Subscriber, DomainParticipant).runtime/cpp/include/— Wire-Laufzeit (zerodds/wire.hpp,dds/rpc.hpp); das Korpus-Gate compiliert dagegen.
Befund, der die Seite trägt: Die C++-Spalte emittiert an keiner Stelle
omg::types. grep -rl "omg::types" crates/ tools/ runtime/ endpoints/
findet genau eine Datei — crates/corba-codegen/src/traits.rs, einen
Rust-CORBA-Generator, nicht diese C++-Bindung. Alle Items, deren
Anforderung ein omg::types-Alias oder -Trait ist, sind deshalb
open oder partial.
§1 Scope
1.1 Mapping IDL v4 -> C++
Spec: §1, S. 1 — “This specification defines the mapping of OMG Interface Definition Language v4 to the C++ programming language.”
Repo: —
Tests: —
Status: n/a (informative) — Scope-Aussage der Spezifikation ohne
Anforderung an eine Implementierung.
§2 Conformance Criteria
2.1 Implementation: IDL -> C++-Quelltext nach Kapitel 7
Spec: §2, S. 1 — “A conformant implementation shall transform IDL input into C++ source code output as specified in Chapter 7.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal,
crates/lang-rules/tests/cpp_corpus_compiles.rs::the_compiler_check_catches_a_deliberate_error
Status: partial — die Datentyp-Transformation ist live und rendert
jeden Korpusfall (bzw. benennt die Verweigerung); das Compiler-Gate prüft
die erzeugten Header. Kapitel 7 ist aber nicht vollständig erfüllt: die
omg::types-Laufzeit (Type Traits, Any, fixed, sequence/string-
Aliase) fehlt, §7.4-Interfaces laufen über die DDS-RPC-Bindung statt über
die generische Form, §7.4.1-Exceptions und §7.6-Valuetypes sind anders
geformt.
§3 Normative References
3.1 [ISO/IEC-14882] und [OMG-*]
Spec: §3, S. 1-2 — [ISO/IEC-14882:1998/2003/2011/2017], [OMG-C++], [OMG-C++11], [OMG-CORBA-COMP], [OMG-CORBA-IFC], [OMG-IDL4].
Repo: —
Tests: —
Status: n/a (informative) — Referenzliste; die C++-Version wird in
§7.1.3, die IDL-Version in §3.9 auditiert.
§4 Terms and Definitions
4.1 Building Block, C++, Language Mapping
Spec: §4, S. 2 — Glossar (Building Block, C++, Language Mapping).
Repo: —
Tests: —
Status: n/a (informative) — Definitionen ohne Code-Anforderung.
§5 Symbols
5.1 Akronyme (Tab.5.1)
Spec: §5 Tab.5.1, S. 2-3 — CCM/CORBA/DDS/IDL.
Repo: —
Tests: —
Status: n/a (informative) — Abkürzungen.
§6 Additional Information
6.1-6.3 Änderungen, Acknowledgments, Intellectual Property Rights
Spec: §6.1-6.3, S. 3.
Repo: —
Tests: —
Status: n/a (informative) — Änderungen an anderen Specs, Danksagung, Rechtehinweise.
§7.1 General
7.1.1 Names
Spec: §7.1.1, S. 5 — “IDL member names and type identifiers shall map to equivalent C++ names and type identifiers with no change.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::tests::a_sequence_is_a_vector_and_a_map_is_a_class_over_a_vector_of_pairs — crates/lang-rules/src/adapter/cpp.rs:2752: assert!(text.contains("std::vector<std::int32_t> items;"), "{text}");
Status: done — der Member-Name items bleibt unverändert. Die einzige
Namensänderung ist das Reserved-Name-Escaping aus §7.1.2.
7.1.2 Reserved Names
Spec: §7.1.2, S. 5-6 — “The use of any of these names for a user-defined IDL type or interface (assuming it is also a legal IDL name) shall result in the mapped name having an underscore (’_’) prepended.”
Repo: crates/lang-cst/src/cpp/mod.rs (escape_keyword)
Tests: crates/lang-cst/src/cpp/mod.rs::a_keyword_escapes_with_a_trailing_underscore — crates/lang-cst/src/cpp/mod.rs:924: assert_eq!(escape_keyword("class"), "class_");
Status: partial — Kollisionen mit C++-Keywords werden erkannt und
umgeschrieben, aber mit einem angehängten Unterstrich
(class -> class_), nicht mit dem von §7.1.2 mandatierten
vorangestellten Unterstrich (_class). Die Erkennung ist vollständig;
das angewandte Mapping weicht ab.
7.1.3 C++ Language Version Requirements
Spec: §7.1.3, S. 6 — “The language mappings defined in this specification require C++11 [ISO/IEC-14882:2011] as the minimum C++ standard version.”
Repo: crates/lang-rules/tests/cpp_corpus_compiles.rs
Tests: crates/lang-rules/tests/cpp_corpus_compiles.rs::every_corpus_case_that_renders_also_compiles — crates/lang-rules/tests/cpp_corpus_compiles.rs:159: .args(["-std=c++20", "-fsyntax-only", "-Wall", "-Wextra", "-Werror"])
Status: done — der Korpus wird unter -std=c++20 syntaktisch geprüft;
das erfüllt die Mindestanforderung C++11 und deckt die tatsächlich
genutzten C++17-Konstrukte (std::optional, inline constexpr) ab. Der
Korpus-Test ist #[ignore] und läuft mit --include-ignored.
7.1.4 IDL Type Traits (Tab.7.1 und Tab.7.4-7.12)
Spec: §7.1.4 Tab.7.1, S. 6-7 — “Type traits shall be available under
the omg::types namespace” (value_type, in_type, out_type,
inout_type, _t/_v-Aliase); dazu die Spezialisierungen Tab.7.4
(Sequences), Tab.7.5 (Strings), Tab.7.6 (Wstrings), Tab.7.7 (digits,
scale), Tab.7.8 (bit_bound, underlying_type), Tab.7.9
(dimensions), Tab.7.10/7.11 (is_bounded, bound, key, elements)
und Tab.7.12 (bit_bound, underlying_type).
Repo: —
Tests: —
Status: open — kein omg::types-Namespace. grep -rl "omg::types" crates/ tools/ runtime/ endpoints/ findet nur
crates/corba-codegen/src/traits.rs (ein Rust-CORBA-Generator). Die
C++-Spalte schreibt std::-Typen direkt; kein Trait der Tabellen 7.1 und
7.4-7.12 wird emittiert.
§7.2 Core Data Types
7.2.1 IDL Specification
Spec: §7.2.1, S. 7 — “There is no direct mapping of the IDL Specification itself.”
Repo: —
Tests: —
Status: n/a (informative) — “There is no direct mapping of the IDL Specification itself.”
7.2.2 Modules
Spec: §7.2.2, S. 7 — “IDL modules shall be mapped to C++ namespaces of the same name. […] IDL declarations not enclosed in any module shall be mapped into the global scope.”
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::a_module_is_a_namespace_and_not_a_prefix — crates/lang-rules/src/adapter/cpp.rs:1987: assert!(text.contains("namespace a {"), "{text}");
Status: done — Module werden zu namespace-Blöcken, Referenzen aus
dem Wurzel-Scope geschrieben (::a::P), kein a_b_P-Präfix.
7.2.3 Constants
Spec: §7.2.3, S. 7-8 — “IDL constants of numeric and boolean types shall be mapped to C++ constexpr declarations […] IDL constants of string type shall be mapped to a constexpr declaration of omg::types::string_view type […] of wstring type […] omg::types::wstring_view […] The constant value of wide character and wide string constants shall be preceded by L.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Konstantenschleife,
cpp_constant)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — numerische und boolesche Konstanten werden als
inline constexpr emittiert. String-, Wstring- und Fixed-Konstanten
werden als const char * ausgegeben, nicht als constexpr omg::types::string_view oder std::string_view; das L-Präfix für Wide-
Literale fehlt, weil wstring als UTF-8 gehalten wird. Keine Assertion
deckt die Konstantenform direkt.
§7.2.4 Data Types
7.2.4.1 Basic Types (Tab.7.2/7.3)
Spec: §7.2.4.1.1-§7.2.4.1.6, S. 8-9 — Integer (Tab.7.2), Floating Point (Tab.7.3), char, wchar, boolean, octet.
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses,
crates/lang-rules/src/adapter/cpp.rs::an_array_nests_with_the_outer_dimension_outermost
Status: partial — long -> std::int32_t ist assertiert (Array-,
Interface- und Verbatim-Tests), und octet/uint8 sowie wchar/
unsigned short fallen auf denselben Typ (Tag-Test). Die übrigen
Tabellenbreiten (short -> int16_t, long long -> int64_t, char,
wchar, boolean, octet, float) haben keine eigene Assertion.
long double wird auf zerodds::wire::Float128 abgebildet statt
auf das C++ long double (§7.2.4.1.2, eigenes Item). cpp_primitive
ist erschöpfend, ein fehlender Grundtyp ist ein Compile-Fehler.
7.2.4.1.2 long double -> long double
Spec: §7.2.4.1.2, Tab.7.3, S. 8 — “long double | long double”.
Repo: —
Tests: —
Status: open — cpp_primitive (crates/lang-rules/src/adapter/cpp.rs) bildet long double auf zerodds::wire::Float128 ab.
7.2.4.2.1 Sequences -> std::vector
Spec: §7.2.4.2.1, S. 9 — “IDL sequences shall be mapped to a C++
std::vector
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type,
Sequence-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::tests::a_sequence_is_a_vector_and_a_map_is_a_class_over_a_vector_of_pairs — crates/lang-rules/src/adapter/cpp.rs:2752: assert!(text.contains("std::vector<std::int32_t> items;"), "{text}");
Status: done — std::vector<T> ist eine von §7.2.4.2.1 zugelassene
Form (die omg::types::sequence-Alternative wird in §7.1.4 auditiert).
7.2.4.2.1 omg::types::sequence/bounded_sequence
Spec: §7.2.4.2.1 Tab.7.4, S. 9 — “implementers shall always define
omg::types::sequence
Repo: —
Tests: —
Status: open — weder omg::types::sequence<T> noch
omg::types::bounded_sequence<T,N> noch die is_bounded/bound-
Spezialisierungen existieren.
7.2.4.2.2 Strings -> std::string
Spec: §7.2.4.2.2, S. 10 — “IDL strings shall be mapped to C++ std::string, or to a type named omg::types::string.”
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type,
String-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — string wird als std::string gehalten
(zugelassene Form). Für den Data-Member existiert keine direkte
Assertion (nur der Tag-Test zeigt, dass string und wstring auf
denselben C++-Typ fallen); omg::types::string fehlt.
7.2.4.2.2 omg::types::string/bounded_string
Spec: §7.2.4.2.2 Tab.7.5, S. 10 — “implementers shall always define
omg::types::string […] omg::types::bounded_string
Repo: —
Tests: —
Status: open — keine omg::types::string/bounded_string<N>-Aliase,
keine is_bounded/bound-Traits.
7.2.4.2.3 Wstrings
Spec: §7.2.4.2.3, S. 11 — “IDL wstrings shall be mapped to C++ std::wstrings, or to a type named omg::types::wstring […].”
Repo: crates/lang-rules/src/adapter/cpp.rs (value_type)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — wstring wird als std::string mit UTF-8 gehalten,
nicht als std::wstring und nicht als omg::types::wstring; die Spec-
Form ist damit nicht erfüllt. Keine direkte Assertion.
7.2.4.2.3 omg::types::wstring/bounded_wstring
Spec: §7.2.4.2.3 Tab.7.6, S. 11 — “omg::types::wstring […]
omg::types::bounded_wstring
Repo: —
Tests: —
Status: open — kein omg::types::wstring/bounded_wstring<N>, keine
Traits.
7.2.4.2.4 Fixed Type
Spec: §7.2.4.2.4, S. 11-12 — “The IDL fixed type shall map to a C++
class named fixed […] under the omg::types namespace” (rund 30
Methoden plus freie Funktionen und die digits/scale-Traits Tab.7.7).
Repo: —
Tests: —
Status: open — die Datentyp-Spalte bildet fixed<P,S> in
crates/lang-rules/src/adapter/cpp.rs auf std::string ab. Die
handgeschriebene dds::core::Fixed<P,S> in
crates/cpp/include/dds/core/Fixed.hpp ist die DDS-PSM-Cxx-Laufzeit
(eine andere Spec) und bietet nur BCD-Round-Trip plus
String-Konvertierung, nicht die ~30 Spec-Methoden; omg::types::fixed
und die digits/scale-Traits fehlen.
7.2.4.3.1 Structures
Spec: §7.2.4.3.1, S. 13 — “An IDL struct shall be mapped to a C++ struct […] default constructor […] copy constructor […] move constructor […] copy assignment […] move assignment […] comparison operators, including at least ‘equal to’ and ‘not equal to’ […] destructor […] swap function in the namespace.”
Repo: crates/lang-rules/src/adapter/cpp_psm.rs (Klasse mit Zugriffsfunktionen, ==, !=, swap), crates/lang-rules/src/adapter/cpp.rs (Structure-Zweig)
Tests: crates/cpp/tests/generated_type_via_cargo.rs::a_psm_mapped_type_round_trips_through_the_dds_psm_writer_and_reader (crates/cpp/tests/generated_psm_roundtrip.cpp: Konstruktoren, Kopie, Verschiebung, swap, Gleichheit)
Status: done — die Standardabbildung (--cpp-mapping psm) erzeugt eine Klasse mit den Zugriffsfunktionen, dem Konstruktor über alle Member, ==, != und swap im Namensraum (§7.12); Kopieren und Verschieben sind die impliziten Funktionen. Die Option native schreibt die Struktur der Codecs mit öffentlichen Membern, swap und, bei Zeigermembern, den erzeugten Kopier- und Verschiebefunktionen, aber ohne ==. Log: .agent/REPORT.md.
7.2.4.3.1 Default-Initialisierung
Spec: §7.2.4.3.1, S. 13 — “A default constructor that initializes all built-in data types to their default value […] enumerators to their first value, and the rest of members using their default constructor.”
Repo: crates/lang-rules/src/adapter/cpp.rs (member_default)
Tests: tools/idlc/tests/cpp_headers_together.rs::two_generated_headers_share_a_translation_unit_and_their_structs_start_at_their_defaults — tools/idlc/tests/cpp_headers_together.rs:126: status.success(),
Status: done — der Test compiliert und führt default-konstruierte
Structs aus; der Exit-Code ist ungleich 0, wenn ein Built-in nicht 0,
bool nicht false, double nicht 0.0, das Enum nicht die erste
Variante oder Array/Sequenz nicht leer sind.
7.2.4.3.2 Unions
Spec: §7.2.4.3.2, S. 14-15 — Klasse mit _d() const/void _d(T),
Member-Accessor/-Modifier je Zweig, Multi-Label-Modifier mit
Discriminator-Parameter und _default().
Repo: crates/lang-rules/src/adapter/cpp.rs (Union-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::a_union_is_a_class_with_a_discriminator_and_one_field_per_case
Status: partial — die Union wird als Klasse mit _d-Feld und einem
Feld pro Zweig emittiert (assertiert: struct U {, std::int32_t _d;).
Die geforderten Zugriffs-/Modifier-Methoden, die Multi-Label-Variante und
_default() fehlen; die Zweige sind öffentliche Felder.
7.2.4.3.3 Enumerations
Spec: §7.2.4.3.3, S. 16 — “An IDL enum shall be mapped to a C++ scoped enum class with the same name as the IDL enum type.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Enumeration-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound — crates/lang-rules/src/adapter/cpp.rs:2050: assert!(narrow.contains("enum class E : std::uint8_t {"), "{narrow}");
Status: done — scoped enum class mit gleichem Namen; das underlying
type wird aus @bit_bound und den Enumeratorwerten gewählt.
7.2.4.3.3 Enumeration Type Traits
Spec: §7.2.4.3.3 Tab.7.8, S. 17 — “bit_bound […] underlying_type.”
Repo: —
Tests: —
Status: open — die bit_bound/underlying_type-Spezialisierungen
werden nicht emittiert (siehe §7.1.4).
7.2.4.3.4 Constructed Recursive Types
Spec: §7.2.4.3.4, S. 16 — “Constructed recursive types are supported by mapping the involved types directly to C++.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Forward-Declarations,
Sequence-/shared_ptr-Zweige)
Tests: crates/lang-rules/tests/external_is_an_indirection.rs::a_recursive_external_member_is_a_shared_pointer_and_not_a_value
Status: partial — Forward-Declarations für Aggregate und
std::vector<T>/std::shared_ptr<T> erlauben Selbstreferenz; belegt ist
nur der @external-Rekursivfall (std::shared_ptr<::m::Node> next;). Der
allgemeine Fall (Selbstreferenz über sequence<Node> ohne @external)
hat keine eigene Assertion.
7.2.4.4 Arrays
Spec: §7.2.4.4, S. 17 — “An IDL array shall be mapped to a C++ std::array of the mapped element type, or to a type named omg::types::array […] Multidimensional arrays shall be constructed nesting std::array.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Array-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_array_nests_with_the_outer_dimension_outermost — crates/lang-rules/src/adapter/cpp.rs:2023: assert!(text.contains("std::array<std::array<std::int32_t, 3>, 2> a = {};"), "{text}");
Status: done — std::array, mehrdimensional outermost-first genestet;
eine von §7.2.4.4 zugelassene Form.
7.2.4.4 omg::types::array und dimensions
Spec: §7.2.4.4 Tab.7.9, S. 17 — “omg::types::array […] dimensions.”
Repo: —
Tests: —
Status: open — omg::types::array und der dimensions-Trait fehlen.
7.2.4.5 Native Types
Spec: §7.2.4.5, S. 17 — “This language mapping specification does not define any native types, but compliant implementations may provide the necessary mechanisms.”
Repo: —
Tests: —
Status: n/a (informative) — die Spec definiert keine nativen Typen;
der Adapter bildet native optional auf void * oder einen
Facetten-Namen ab.
7.2.4.6 Naming Data Types
Spec: §7.2.4.6, S. 17 — “IDL typedefs shall be mapped to type alias declarations.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Alias-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — typedef wird als cpp::Alias (C++ using)
emittiert; keine Assertion prüft die Alias-Deklaration direkt, und der
Korpus-Compile unterscheidet eine Alias- nicht von einer Makro-Form.
§7.3 Any
7.3 Any -> omg::types::Any
Spec: §7.3, S. 18 — “The IDL any type shall be mapped to a C++ omg::types::Any type.”
Repo: —
Tests: —
Status: open — any wird in crates/lang-rules/src/adapter/cpp.rs
(cpp_value_type, TypeKind::Any) mit NoLanguageForm abgelehnt
(Test an_any_member_is_refused_by_name_at_any_depth, auch für
sequence<any>). Kein omg::types::Any.
§7.4 Interfaces – Basic
7.4 Interfaces -> C++-Klassen
Spec: §7.4, S. 18-19 — “Each IDL interface shall be mapped to a C++
class […] Each attribute […] pair of pure virtual methods […] Each
operation […] pure virtual method […] IDL out and inout arguments
shall be passed by reference […] in arguments […] by value […] and
as a reference to const otherwise. Parameters of interface type T shall
be mapped to std::shared_ptr
Repo: crates/lang-rules/src/emit/interface_cpp.rs
Tests: crates/lang-rules/tests/interface_bindings.rs::cpp_declares_the_synchronous_operations_of_rule_six,
crates/lang-rules/tests/interface_bindings.rs::cpp_names_an_attribute_accessor_after_the_attribute
Status: partial — Interfaces werden über die
DDS-RPC-1.0-§7.11.1-Bindung als Klassen mit pure-virtual Operationen und
Attribut-Accessoren emittiert (assertiert: in by value/const ref,
out/inout by reference, Accessor nach Attributnamen). Die Bindung
folgt DDS-RPC 1.0 und fügt IAsync/Requester/Replier/Client/
Service hinzu, die §7.4 nicht kennt; omg::types::ref_type<T>/
weak_ref_type<T> für Interface-Parameter fehlen.
7.4.1 Exceptions
Spec: §7.4.1, S. 19-20 — “An IDL exception shall be mapped to a C++ class […] shall extend the std::exception class […] copy constructor, move constructor, assignment operator, move operator, and destructor […] what() method […] explicit constructor with one parameter for each exception member […] and a parameter of type const char *.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Exceptions-Schleife)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — eine IDL-Exception wird als struct mit ihren
Membern emittiert. Die geforderte Ableitung class X : public std::exception, what(), Copy-/Move-Konstruktor, Zuweisungsoperatoren
und der explizite (member..., const char* what)-Konstruktor fehlen
vollständig.
7.4.2 Interface Forward Declaration
Spec: §7.4.2, S. 20 — “An IDL interface forward declaration shall be mapped to a partial forward declaration in C++.”
Repo: —
Tests: —
Status: open — Interface-Vorwärtsdeklarationen werden nicht
emittiert; der Datentyp-Adapter schreibt Forward nur für Structure,
Union und Valuetype. interface Foo; ohne Definition wird von
crates/lang-rules/src/adapter/interface.rs als ForwardWithoutDefinition
abgelehnt (Test
crates/lang-rules/tests/interface_bindings.rs::a_forward_declaration_without_a_definition_is_e002).
§7.5 Interfaces – Full
7.5 Embedded Declarations und static constexpr
Spec: §7.5, S. 20 — “adding to mapped class the declaration every type, exception, or constant declaration in the IDL interface body. […] constexpr declarations shall be marked as static.”
Repo: —
Tests: —
Status: open — die DDS-RPC-Bindung in
crates/lang-rules/src/emit/interface_cpp.rs emittiert Topic-Typen und
Operationsklassen, aber keine verschachtelten Typ-/Exception-/Konstanten-
Deklarationen im Interface-Rumpf und kein static constexpr innerhalb
der Klasse.
§7.6 Value Types
7.6 Valuetype -> abstrakte Klasse
Spec: §7.6, S. 21 — public/private state members -> public/protected
pure-virtual accessor and modifier methods; factory operations ->
<ValueTypeName>_factory; inheritance via public virtual; supports
interface -> all operations as pure virtual.
Repo: crates/lang-rules/src/adapter/cpp.rs (Valuetype-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — valuetype wird wie ein struct behandelt: seine
Member werden Felder. Die geforderten public/protected pure-virtual
Accessor-/Modifier-Methoden, die <ValueTypeName>_factory-Klasse, die
public-virtual Vererbung und die Operationen unterstützter Interfaces
fehlen.
§7.7-§7.13 CORBA, Components und Template Modules
7.7/7.8 CORBA-Specific Interfaces und Value Types
Spec: §7.7-7.8, S. 22 — verweist auf Annex A.1.
Repo: —
Tests: —
Status: n/a (informative) — die Klausel selbst definiert kein
Mapping; Annex A.1 wird gesondert auditiert.
7.9/7.10 Components – Basic und Homes
Spec: §7.9-7.10, S. 22 — “mapped to equivalent IDL, as specified in [OMG-CORBA-COMP].”
Repo: —
Tests: —
Status: open — die Transformation in äquivalentes IDL gibt es (crates/ccm/src/transform.rs, Tests in crates/ccm/tests/equivalent_idl.rs), der C++-Pfad von zerodds-idlc wendet sie nicht an: tools/idlc und crates/lang-rules hängen nicht an zerodds-ccm.
7.11 CCM-Specific
Spec: §7.11, S. 22 — verweist auf Annex A.1.
Repo: —
Tests: —
Status: n/a (informative) — Verweis auf Annex A.1.
7.12/7.13 Components – Ports/Connectors und Template Modules
Spec: §7.12-7.13, S. 22 — “mapped to intermediate IDL, as specified in [OMG-IDL4].”
Repo: crates/idl-lower/src/lower.rs (template_module_inst)
Tests: crates/idl-lower/tests/dialects.rs::an_instantiation_lowers_the_body_with_the_actual_substituted, crates/idl-lower/tests/dialects.rs::two_instantiations_of_one_template_are_two_independent_modules
Status: partial — eine Instanziierung eines Template Module wird im Modell zu einem gewöhnlichen Modul, das die C++-Spalte abbildet. Ports und Connectoren werden nicht in Intermediate-IDL übersetzt; eigenes Item.
7.12 Ports und Connectoren als Intermediate-IDL
Spec: §7.12, S. 22 — Ports und Connectoren werden “mapped to intermediate IDL, as specified in [OMG-IDL4]”.
Repo: —
Tests: —
Status: open — die C++-Spalte übersetzt porttype, port, mirrorport und connector nicht in Intermediate-IDL.
§7.14 Extended Data Types
7.14.1 Structures with Single Inheritance
Spec: §7.14.1, S. 23 — “shall inherit from the mapped base struct using public inheritance. […] swap method […] which shall ensure that all inherited members are swapped.”
Repo: crates/lang-rules/src/adapter/cpp.rs (all_members_of)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — Basis-Member werden flach in den abgeleiteten
Struct kopiert (all_members_of), nicht als struct Child : Base mit
public inheritance; die swap-Funktion für geerbte Member fehlt. Die
flache Form hält die Member-Reihenfolge des Wire-Plans; eigenes Item.
7.14.1 Public Inheritance und swap der geerbten Member
Spec: §7.14.1, S. 23 — “shall inherit from the mapped base struct using public inheritance. […] swap method […] which shall ensure that all inherited members are swapped.”
Repo: —
Tests: —
Status: open — all_members_of (crates/lang-rules/src/adapter/cpp.rs) kopiert die Basis-Member flach in die abgeleitete Struktur; keine Basisklasse, kein swap für geerbte Member.
7.14.2 Union Discriminators
Spec: §7.14.2, S. 23 — “adds the wchar, and octet IDL types to the set of valid types for a discriminator. […] int8 and uint8 are valid union discriminators.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Union-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::a_union_is_a_class_with_a_discriminator_and_one_field_per_case
Status: partial — der Discriminator läuft durch cpp_value_type und
akzeptiert jeden integralen Typ; assertiert ist nur switch (long).
wchar, octet, int8 und uint8 als Discriminator haben keine eigene
Assertion.
7.14.3.1 Maps
Spec: §7.14.3.1, S. 23-24 — “IDL maps shall be mapped to a C++ std::map<Key,T> […] or to a type named omg::types::map<Key,T> […] omg::types::bounded_map<Key, T, N>.”
Repo: crates/lang-rules/src/adapter/cpp_psm.rs (Map-Zweig)
Tests: crates/cpp/tests/generated_type_via_cargo.rs::a_psm_mapped_type_round_trips_through_the_dds_psm_writer_and_reader
Status: done — map<K,V> ist in der Standardabbildung (psm) std::map<K,V>; --cpp-mapping native und classic sind benannte Optionen (zerodds::Map, Reihenfolge der Entries als Achse des Codec). omg::types::map und bounded_map gibt es nicht; die Spec lässt std::map genügen. Log: .agent/REPORT.md.
7.14.3.1 Map Type Traits
Spec: §7.14.3.1 Tab.7.10/7.11, S. 24 — “is_bounded […] bound […] key […] elements.”
Repo: —
Tests: —
Status: open — kein omg::types::map/bounded_map und keine der
vier Traits.
7.14.3.2 Bitsets
Spec: §7.14.3.2, S. 24-25 — “IDL bitset types shall be mapped to C++ structs that meet the C++ requirements for aggregate initialization. The only members of these structs are bit fields. […] shall derive (using public inheritance) from the struct resulting from mapping the base type.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Bitset-Zweig)
Tests: crates/lang-rules/tests/cpp_reader_generates.rs::every_kind_table_9_answers_for_gets_a_defaulter
Status: partial — Bitsets werden als Struct mit getrennten Integer-Membern emittiert und im Codec gepackt, nicht als C++-Bitfields; Basis-Bitfields werden flach einbezogen, nicht per public inheritance. Die Spec verlangt Bitfields als einzige Member.
7.14.3.3 Bitmask Type
Spec: §7.14.3.3, S. 25-26 — “struct type containing […] unscoped enum named _flags […] private member named _value […] default constructor and a copy constructor […] !=, &=, and ^= bitwise operators […] function call operator that returns _value.”
Repo: crates/lang-rules/src/adapter/cpp.rs (Bitmask-Zweig)
Tests: crates/lang-rules/src/adapter/cpp.rs::every_corpus_case_renders_or_names_its_refusal
Status: partial — eine Bitmask wird als Integer-Alias
(uint8/16/32/64) plus inline constexpr-Bit-Konstanten emittiert, nicht
als struct mit unscoped _flags-Enum, privatem _value, Konstruktoren,
!=/&=/^=-Operatoren und Aufrufoperator. Die
bit_bound/underlying_type-Traits fehlen.
7.14.4 8-bit Integer Types (Tab.7.13)
Spec: §7.14.4 Tab.7.13, S. 26 — “int8 -> int8_t; uint8 -> uint8_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — octet/uint8 fallen auf denselben
std::uint8_t (Tag-Test). int8 -> std::int8_t hat keine eigene
Assertion.
7.14.5 Explicitly-Named Integer Types (Tab.7.14)
Spec: §7.14.5 Tab.7.14, S. 26-27 — “int16/uint16/int32/uint32/int64/uint64 -> int16_t/uint16_t/int32_t/uint32_t/int64_t/uint64_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (cpp_primitive)
Tests: crates/lang-rules/src/adapter/cpp.rs::the_tag_keeps_apart_what_the_cpp_spelling_collapses
Status: partial — die expliziten Breiten sind in cpp_primitive
abgebildet, aber keine Assertion nennt int16/uint16/int32/uint32/
int64/uint64 einzeln.
§7.15 Anonymous Types
7.15 Anonymous Types
Spec: §7.15, S. 27 — “No impact to the C++ language mapping.”
Repo: —
Tests: —
Status: n/a (informative) — kein Mapping-Impact.
§7.16 User-Defined Annotations
7.16 User-Defined Annotations
Spec: §7.16, S. 27 — “User-defined annotations are not propagated to the generated C++ code.”
Repo: —
Tests: —
Status: n/a (informative) — die C++-Spalte trägt keine
Nutzer-Annotationen in die Ausgabe; die Klausel stellt keine
Emissionsanforderung.
§7.17 Standardized Annotations
7.17.1 General Purpose: @optional
Spec: §7.17.1 Tab.7.15, S. 27 — “IDL elements annotated with
@optional of type T shall map to std::optional
Repo: —
Tests: —
Status: open — keine Abbildung schreibt std::optional<T>: die Standardabbildung (psm) schreibt dds::core::optional<T> (DDS-PSM-Cxx), die Option native einen Zeiger T * (DDS-XTypes 1.3 §7.5.1.2.4.2), die Option classic zerodds::classic::Optional<T>. Die Form von IDL4 to C++ 1.0 §7.17.1 fehlt als benannte Option. Belege der vorhandenen Formen: crates/lang-rules/src/adapter/cpp_psm.rs (dds::core::optional<T>), crates/lang-rules/src/adapter/cpp.rs (T *), crates/lang-rules/src/adapter/cpp_classic.rs (zerodds::classic::Optional<T>); Tests crates/lang-rules/src/adapter/cpp.rs::tests::an_optional_member_is_a_plain_pointer_and_not_a_second_field, crates/cpp/tests/generated_psm_roundtrip.cpp.
7.17.1 General Purpose: @value, @position, @id, @autoid, @extensibility
Spec: §7.17.1 Tab.7.15, S. 27-28 — @value liefert den
Enumeratorwert; @position wirkt auf die Bitmask; @id, @autoid,
@extensibility, @final, @mutable, @appendable sind ohne Impact.
Repo: crates/lang-rules/src/adapter/cpp.rs
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound
Status: partial — @value erreicht den Enumeratorwert (der Adapter
schreibt jeden Wert aus), ist aber nicht direkt assertiert; @position
hängt an der Bitmask, die selbst partial ist (§7.14.3.3); @id,
@autoid, @extensibility, @final, @mutable und @appendable werden
bestimmungsgemäß nicht ins C++ übertragen.
7.17.2 Data Modeling: @key, @must_understand, @default_literal
Spec: §7.17.2 Tab.7.16, S. 28 — @key/@must_understand ohne
Impact; “The C++ element declared as result of the mappings […]
shall be initialized to the element indicated by [@default_literal].”
Repo: crates/lang-rules/src/adapter/cpp.rs (member_default)
Tests: tools/idlc/tests/cpp_headers_together.rs::two_generated_headers_share_a_translation_unit_and_their_structs_start_at_their_defaults
Status: partial — @key und @must_understand sind laut Spec ohne
Impact. @default_literal wird nicht ausgewertet: der Member-Default
nimmt die erste Enumeratorvariante, nicht die mit @default_literal
markierte.
7.17.3 Units and Ranges: @default, @range, @min, @max, @unit
Spec: §7.17.3 Tab.7.17, S. 28-29 — @range -> omg::types::ranged<T, min, max> mit std::out_of_range; @min/@max -> Setter werfen
std::out_of_range; @unit ohne Impact; @default initialisiert.
Repo: —
Tests: —
Status: open — kein omg::types::ranged<T,min,max>, keine Setter
(die Datenmember sind öffentliche Felder) und damit keine
std::out_of_range-Prüfung für @range/@min/@max. @default wird
im Codec-Defaulter (crates/lang-rules/src/default_cpp.rs) ausgewertet,
aber nicht als C++-Member-Initialisierer des generierten Structs.
7.17.4 Data Implementation: @bit_bound
Spec: §7.17.4 Tab.7.18, S. 29-30 — “int8_t, for bit bound values between 1 and 8; int16_t […] int32_t […] int64_t.”
Repo: crates/lang-rules/src/adapter/cpp.rs (enum_underlying,
cpp_holder)
Tests: crates/lang-rules/src/adapter/cpp.rs::an_enumeration_takes_an_underlying_type_from_its_bit_bound
Status: partial — für Enums ist das underlying type assertiert; für Bitmasken folgt der Adapter derselben Breitenregel, aber die Bitmask- Abbildung ist selbst partial (§7.14.3.3).
7.17.4 Data Implementation: @external
Spec: §7.17.4 Tab.7.18, S. 29-30 — “mapped to std::shared_ptr
Repo: crates/lang-rules/src/adapter/cpp.rs (held_externally,
shared_ptr-Zweige)
Tests: crates/lang-rules/tests/external_is_an_indirection.rs::a_recursive_external_member_is_a_shared_pointer_and_not_a_value — crates/lang-rules/tests/external_is_an_indirection.rs:118: generated.contains("std::shared_ptr<::m::Node> next;"),
Status: partial — @external T wird als std::shared_ptr<T>
gehalten (assertiert). Die geforderte tiefe Kopie im Copy-Konstruktor
fehlt: der compiler-generierte Copy-Konstruktor kopiert den shared_ptr
flach, das Objekt wird also geteilt.
7.17.4 Data Implementation: @nested
Spec: §7.17.4 Tab.7.18, S. 29-30 — “No impact on the language mapping.”
Repo: —
Tests: —
Status: n/a (informative) — kein Mapping-Impact.
7.17.5 Code Generation: @verbatim
Spec: §7.17.5 Tab.7.19, S. 30 — “Copies verbatim text to the indicated output position when the indicated language is ’*‘, ’c++’, ‘cpp’, ‘cc’, or ‘cxx’.”
Repo: crates/lang-rules/src/verbatim.rs,
crates/lang-rules/src/adapter/cpp.rs (weave_verbatim)
Tests: crates/lang-rules/tests/verbatim_end_to_end.rs::cpp_answers_to_its_alias_spellings_case_insensitively — crates/lang-rules/tests/verbatim_end_to_end.rs:150: generated.contains("// vb-alias"),
Status: partial — alle sechs Platzierungen (BEGIN_FILE,
BEFORE/BEGIN/END/AFTER_DECLARATION, END_FILE) und die Sprachen c++,
cpp, cxx sowie * sind live (assertiert). cc — von Tab.7.19
ausdrücklich genannt — fehlt in verbatim::aliases::CPP
(&["c++", "cpp", "cxx"]).
7.17.6 Interfaces: @service, @oneway, @ami
Spec: §7.17.6 Tab.7.20, S. 30 — “Options are ‘CORBA’, ‘DDS’, ’*’. Impact is platform-specific.”
Repo: crates/lang-rules/src/emit/interface_cpp.rs
Tests: crates/lang-rules/tests/interface_bindings.rs::cpp_declares_the_asynchronous_operations_of_rule_seven
Status: partial — @oneway (keine Reply-Topic, future<void>-Async)
und @service (Service-Name) werden über die DDS-RPC-Bindung behandelt;
@ami hat keinen eigenen Pfad. Tab.7.20 erklärt den Impact ausdrücklich
für plattformspezifisch.
§8 IDL to C++ Language Mapping Annotations
8.1 @cpp_mapping Annotation
Spec: §8.1, S. 31 — “enum StructMapping { STRUCT_WITH_PUBLIC_MEMBERS, CLASS_WITH_PUBLIC_ACCESSORS_AND_MODIFIERS }; StructMapping struct_mapping default STRUCT_WITH_PUBLIC_MEMBERS.”
Repo: —
Tests: —
Status: open — die Annotation wird nicht ausgewertet; die Form der Strukturen wählt die Option --cpp-mapping je Lauf (Vorgabe psm: Klasse mit Zugriffsfunktionen), nicht @cpp_mapping je Struktur, und der Vorgabewert der Annotation ist STRUCT_WITH_PUBLIC_MEMBERS.
8.1.1 CLASS_WITH_PUBLIC_ACCESSORS_AND_MODIFIERS
Spec: §8.1.1, S. 31-32 — “mapping the annotated IDL struct to C++ class where all members are only accessible via public accessor methods, and may only be modified through public modifier methods.”
Repo: —
Tests: —
Status: open — kein Pfad emittiert die annotierte Struct als Klasse
mit privaten Membern, Accessoren/Modifikatoren und initialisierendem
Konstruktor. @cpp_mapping wird von
crates/lang-rules/src/adapter/cpp.rs nicht gelesen.
Annex A: Platform-Specific Mappings
A.1 CORBA-Specific Mappings
Spec: Annex A.1, S. 33-66 — CORBA::traits<> (value_type,
in_type, out_type, inout_type, Tabellen A.1-A.15),
CORBA::servant_traits<>, TypeCode, ORB, Object, Any, Value Types,
Abstract Interfaces, Server Side Mapping, DSI, PortableServer.
Repo: —
Tests: —
Status: open — kein CORBA::traits<>/CORBA::servant_traits<> in
der C++-Spalte und kein omg::types. crates/corba-codegen/src/traits.rs
ist ein Rust-CORBA-Generator und nicht diese C++-Bindung.
A.2 DDS-Specific Mappings
Spec: Annex A.2, S. 66 — “DDS requires no additional platform-specific language mappings.”
Repo: —
Tests: —
Status: n/a (informative) — die Spec fordert keine zusätzliche
DDS-spezifische C++-Abbildung.
Annex B: Building Block Traceability Matrix
Spec: Annex B (non-normative), S. 67.
Repo: —
Tests: —
Status: n/a (informative) — Annex B ist „non-normative“.
Annex C: Compatibility Rules for C++98 and C++03
Spec: Annex C (normative), S. 69-77 — alternative Mappings für C++98 und C++03.
Repo: —
Tests: —
Status: open — eine optionale Abbildung; die PSM-Spalte (--cpp-mapping psm) zielt auf C++17 (§7.1.3) und hat keine Form für C++98 oder C++03.
Annex D: IDL4 Mapping Rules for Classic C++ Mapping Specifications
Spec: Annex D, S. 79-89 — Mappings für die klassischen C++- und C++11-Specs.
Repo: crates/lang-rules/src/adapter/cpp_classic.rs (CppMapping::Classic), runtime/cpp/include/zerodds/map.hpp (zerodds::Map)
Tests: tools/idlc/tests/cpp_classic.rs::the_classic_types_are_cpp03_and_the_codec_writes_the_native_bytes
Status: partial — ZeroDDS hat eine klassische Abbildung nach [OMG-C++] (--cpp-mapping classic, C++03), für die Annex D gilt. Die Map-Klasse folgt D.2.1.3.1 nicht (eigenes Item); die übrigen Regeln von D.2 sind nicht einzeln gegen die Abbildung geprüft. D.3 betrifft die C++11-Abbildung [OMG-C++11], die ZeroDDS nicht hat.
Annex D.2.1.3.1 Maps in der klassischen Abbildung
Spec: Annex D.2.1.3.1, S. 80 — eine Map wird eine C++-Klasse mit Default-Konstruktor, operator[], ULong maximum() const, ULong length() const, void clear(), Boolean insert(const K&, const T&, Boolean replace = TRUE), Boolean insert_or_assign(const K&, const T&) und Boolean erase(const K&).
Repo: —
Tests: —
Status: open — zerodds::Map (runtime/cpp/include/zerodds/map.hpp) hat get_size, get_max_size, set_max_size, insert und erase mit DDS::ReturnCode_t, aber nicht maximum(), length(), clear(), insert_or_assign und die Rückgaben als Boolean.
Audit-Status
9 done / 26 partial / 22 open / 0 blocked / 14 n/a (informative).
Offene Punkte: idl4-cpp-1.0.open.md.