Skip to main content

Module rpc

Module rpc 

Source
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 + _async signatures plus <Service>HandlerInterface for the server side.
  • Requester class — typed <Service>_Requester wrapper that inherits from the generic [dds::rpc::Requester<TIn, TOut>] template and exports a Future<TOut> name_async(TIn) plus TOut name(TIn) API per method.
  • Replier class — typed <Service>_Replier wrapper with dispatch_to_handler, which binds a [<Service>HandlerInterface] to method dispatch.
  • ServiceTraitsdds::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 itemCoverage
§10.2 dds::rpc namespacedone — all generated classes live under dds::rpc::*.
§10.3 ServiceTraitsdone — specialized per service.
§10.4 Requester templatedone — generic + typed per-service wrapper.
§10.5 Replier templatedone — generic + typed per-service wrapper + HandlerInterface.
§10.5 operation namingdone — <Service>_<method>_In/Out directly from C6.1.B.
§10.6 RemoteExceptiondone — hierarchy + mapping per IDL exception via emit_remote_exception_class.
§10.7 Promise/Futuredone — dds::rpc::Future<T> + Promise<T> as a std::future wrapper.
§10.7 async APIdone — <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 name mapping (§7.5.1.1.3) — no attribute slots in the current zerodds_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).