zerodds_corba_codegen/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! Crate `zerodds-corba-codegen`. Safety classification: **STANDARD**.
5//!
6//! OMG CORBA 3.3 Annex-A.1 IDL-mapping codegen helpers — pure Rust
7//! `no_std + alloc`, `forbid(unsafe_code)`. Provides tables + helpers
8//! that [`zerodds-idl-cpp`], [`zerodds-idl-csharp`] and
9//! [`zerodds-idl-java`] consume to generate CORBA stub/skeleton code.
10//!
11//! Spec: OMG CORBA 3.3 Part 1 Annex A (IDL-Type-Mappings) +
12//! `formal/2008-01-09` IDL-to-C++ + `formal/2008-01-04` IDL-to-Java.
13//!
14//! ## Layer position
15//!
16//! Layer 8 — CORBA stack. Substrate for the three OMG-PSM codegen
17//! crates ([`zerodds-idl-cpp`] / [`zerodds-idl-csharp`] /
18//! [`zerodds-idl-java`]).
19//!
20//! [`zerodds-idl-cpp`]: ../zerodds_idl_cpp/index.html
21//! [`zerodds-idl-csharp`]: ../zerodds_idl_csharp/index.html
22//! [`zerodds-idl-java`]: ../zerodds_idl_java/index.html
23//!
24//! ## Public API (Stand 1.0.0-rc.1)
25//!
26//! - [`SpecialType`] / [`TargetLanguage`] / [`language_mapping`] —
27//! 13 Annex-A.1 Special-Types (Object, ValueBase, AbstractBase,
28//! NativeRef, TypeCode, any, sequence-of-any, string, wstring,
29//! Time, fixed, ULongLong, LongDouble) with language mappings for
30//! C++ / C# / Java.
31//! - [`StubOp`] / [`render_stub_op`] — client-stub template (sends a
32//! GIOP request, expects a reply with a ReplyStatus switch).
33//! - [`SkeletonOp`] / [`render_skeleton_dispatch`] — server-side
34//! dispatch template (operation-name switch).
35//! - [`build_repository_id`] — repository-ID builder (spec §10.7.3.1)
36//! for IDL `module`/`interface` paths.
37//!
38//! ## Example
39//!
40//! ```rust
41//! use zerodds_corba_codegen::build_repository_id;
42//!
43//! let id = build_repository_id(&["MyModule"], "MyInterface", 1, 0);
44//! assert_eq!(id, "IDL:MyModule/MyInterface:1.0");
45//! ```
46
47#![cfg_attr(not(feature = "std"), no_std)]
48#![forbid(unsafe_code)]
49#![warn(missing_docs)]
50
51#[cfg(feature = "alloc")]
52extern crate alloc;
53
54pub mod repository_id;
55pub mod skeleton;
56pub mod special_types;
57pub mod stub;
58
59pub use repository_id::build_repository_id;
60pub use skeleton::{SkeletonOp, render_skeleton_dispatch};
61pub use special_types::{SpecialType, TargetLanguage, language_mapping};
62pub use stub::{StubOp, render_stub_op};