Expand description
C6.1.D-cpp: DDS-RPC C++ PSM-Codegen.
Spec-Referenz: OMG DDS-RPC 1.0 (formal/16-12-04), §10 — C++ PSM.
This layer emits four building blocks per zerodds_rpc::ServiceDef:
- Service interface — abstract class
<Service>with per-method sync +_asyncsignatures plus<Service>HandlerInterfacefor the server side. - Requester class — typed
<Service>_Requesterwrapper that inherits from the generic [dds::rpc::Requester<TIn, TOut>] template and exports aFuture<TOut> name_async(TIn)plusTOut name(TIn)API per method. - Replier class — typed
<Service>_Replierwrapper withdispatch_to_handler, which binds a [<Service>HandlerInterface] to method dispatch. - ServiceTraits —
dds::rpc::ServiceTraits<<Service>>specialization with topic names + mapping variant.
The generic templates live under
templates/dds-psm-cxx/rpc/{requester,replier,exception,service_traits}.hpp.tmpl
and are embedded via include_str!.
§Spec §10 coverage
| §10 item | Coverage |
|---|---|
§10.2 dds::rpc namespace | done — all generated classes live under dds::rpc::*. |
| §10.3 ServiceTraits | done — specialized per service. |
| §10.4 Requester template | done — generic + typed per-service wrapper. |
| §10.5 Replier template | done — generic + typed per-service wrapper + HandlerInterface. |
| §10.5 operation naming | done — <Service>_<method>_In/Out directly from C6.1.B. |
| §10.6 RemoteException | done — hierarchy + mapping per IDL exception via emit_remote_exception_class. |
| §10.7 Promise/Future | done — dds::rpc::Future<T> + Promise<T> as a std::future wrapper. |
| §10.7 async API | done — <method>_async returns Future<TOut>. |
§Deliberately not in the crate
- Live-FFI binding to the Rust RPC runtime — source only.
- Promise/Future optimization (skeleton without a listener-style API).
attribute T namemapping (§7.5.1.1.3) — no attribute slots in the currentzerodds_rpc::ServiceDef.g++/clang++compile test — not part of CI.
Functions§
- emit_
remote_ exception_ class - Emits a concrete RemoteException subclass from an IDL
exception E { ... }declaration (spec §10.6). - emit_
replier_ class - Emits the typed replier class for a service.
- emit_
requester_ class - Emits the typed requester class for a service.
- emit_
rpc_ runtime_ headers - Emits the generic RPC header templates (Requester/Replier/ Exception/ServiceTraits) as a merged header block.
- emit_
service_ full_ header - Emits a complete RPC service header (interface + requester + replier + ServiceTraits) for a single service.
- emit_
service_ interface - Emits the service interface (abstract class + HandlerInterface).
- emit_
service_ traits - Emits the
ServiceTraits<<Service>>specialization (spec §10.3).