Skip to main content

Module typeobject_bridge

Module typeobject_bridge 

Source
Expand description

XML → TypeObject Bridge (Cluster C4.5-b).

Converts the internal XML data model from [xtypes_def] into the XTypes-1.3 TypeObject format from zerodds-types. Wire-/hash-compatible with the IDL lowering from zerodds-idl::semantics::to_typeobject.

§Spec sources

  • OMG XTypes 1.3 §7.3.4.x — TypeObject + Minimal/Complete variants.
  • OMG XTypes 1.3 §7.3.4.5 — MinimalStructType / EnumType / UnionType.
  • OMG XTypes 1.3 Annex A — XML mapping.

§Scope C4.5-b (this stage)

  • MinimalTypeObject only. CompleteTypeObject not implemented.
  • Top-level mapping (struct, enum, union, typedef, bitmask, bitset).
  • Member types via TypeRef::Primitive (direct) or TypeRef::Named (lookup in TypeLibrary with hash precomputation).
  • The modifiers arrayDimensions/sequenceMaxLength/stringMaxLength wrap the member TypeIdentifier in PlainArray-/PlainSequence-/ string-bound variants.
  • Member IDs: @id from XSD if set, otherwise sequential from 1 (AUTOID_SEQUENTIAL, Spec §7.3.1.2.1.1).
  • Extensibility: map final/appendable/mutable from Extensibility onto StructTypeFlag/UnionTypeFlag.

§Deliberately not in the crate

  • CompleteTypeObject (comes in phase 6).
  • Forward declarations / cross-library refs.
  • Inheritance via baseType — the bridge does set base_type as EquivalenceHashMinimal, but cycle detection remains the task of the existing crate::inheritance module.
  • @autoid(HASH) — XML schema has no corresponding annotation.

Enums§

BridgeError
Error during the XML→TypeObject mapping.

Functions§

bridge_library
Converts a whole TypeLibrary into a map Name → MinimalTypeObject. Named refs between types within the library are resolved in a two-stage pass:
xml_type_to_minimal_typeobject
Like xml_type_to_typeobject, but directly as a MinimalTypeObject (without the discriminator wrapper).
xml_type_to_typeobject
Converts a single XmlType-TypeDef into a TypeObject (minimal variant).