Skip to main content

Module interface_cpp

Module interface_cpp 

Source
Expand description

An IDL interface, as the C++ language binding DDS-RPC 1.0 §7.11.1 specifies.

adapter::interface reads the interface; this writes the C++. The split is the one every column in this crate keeps — one reading of the IDL clause, one spelling per language — and here it earns itself twice over, because §7.11.2.3 makes the Java function-call binding the same entities as C++ and emit::interface_java therefore walks the same Service values.

§What comes out

Per interface I, in the namespace its module names:

  • the topic types of §7.5.1.1.4-7 — I_<op>_In, I_<op>_Out, I_Call, I_Return, I_Request, I_Reply — whose names come from adapter::interface and whose shape is crates/rpc/src/codegen.rs’s;
  • ISupport, so §7.11.1.1.2 rule 3’s SupportType typedef names something that exists;
  • I and IAsync, the two abstract classes of rules 1-7;
  • IRequester and IReplier, the typed aliases of §7.11.1.1.1 over the generic dds::rpc::Requester / dds::rpc::Replier templates;
  • IClient and IService, the function-call entities of §7.11.1.5.

§Reserved words

§7.11.1.1.2 rule 8 prefixes an identifier that is a C++ reserved word with cxx_. This binding does that for every identifier it introduces: the interface, its operations, its parameters. The type declarations come from adapter::cpp, which gives a struct, an enumeration, an exception or a module named by a reserved word the same prefix (adapter::cpp::cxx_name); this binding refers to them by that spelling.

§What this does not do

It does not implement dds::rpc. §7.11.1.4 lists some twenty class templates — Requester, Replier, future, LoanedSamples and the rest — which are the C++ PSM’s runtime and not a per-service artefact. What is generated here uses them: IClient’s operations call through a Requester, IService::dispatch answers through a Replier, and the topic types have the codec the two ask for (mod codec, mod calls).

Functions§

cpp_interface_items
The C++ declarations every interface of ast produces.
cpp_interface_items_with
cpp_interface_items for the given service mapping.
cpp_service_items
The C++ declarations one interface produces.
cxx_escape
DDS-RPC 1.0 §7.11.1.1.2 rule 8.
remote_member_types
The types the operations of the remote interfaces of ast carry (the parameters, the return values and the members of the exceptions they raise), each once: the types whose codecs a binding of the interfaces calls, in any language.