{ "format": 1, "id": "saw-rpc_server-loopback", "kind": "class", "name": "rpc_server", "namespace": "saw", "module": "remote", "header": "modules/remote/c++/remote_loopback.hpp", "is_special": true, "specializes": "saw-rpc_server", "arguments": ["Iface", "Encode", "rmt::Loopback"], "brief_description": "Answers calls inline against the data servers of its address.", "detailed_description": [ [ "Translates a call on an id into a call on the local interface: it looks the parameter up in the data server of the request schema, calls the function, and stores the answer in the data server of the response schema." ], [ "The data itself never passes through the rpc layer. Registering with its", {"name": "remote", "id": "saw-remote-loopback"}, "on construction is what makes rpc_connect able to find it." ] ], "templates": [ {"name": "Iface", "kind": "type"}, {"name": "Encode", "kind": "type"} ], "aliases": { "saw-rpc_server-loopback-InterfaceT": { "id": "saw-rpc_server-loopback-InterfaceT", "name": "InterfaceT", "type": ["interface< Iface, Encode >"], "brief_description": "The implementations backing the interface." }, "saw-rpc_server-loopback-TypeGroup": { "id": "saw-rpc_server-loopback-TypeGroup", "name": "TypeGroup", "type": ["typename schema_iface_type_group< Iface >::Type"], "brief_description": "Every schema the interface mentions, reduced to unique types." }, "saw-rpc_server-loopback-DataServers": { "id": "saw-rpc_server-loopback-DataServers", "name": "DataServers", "type": ["std::tuple< ptr<", {"name": "data_server", "id": "saw-data_server-loopback"}, "< T, Encode, rmt::Loopback > >... >"], "brief_description": "One data server pointer per schema in the type group." } }, "attributes": { "saw-rpc_server-loopback-class_id": { "id": "saw-rpc_server-loopback-class_id", "name": "class_id", "type": ["std::pair< uint32_t, uint32_t >"], "visibility": "public", "static": true, "constexpr": true, "initializer": "{schema_hash::apply(), schema_hash::apply()}", "brief_description": "Identifies which interface this server provides." }, "saw-rpc_server-loopback-iface_": { "id": "saw-rpc_server-loopback-iface_", "name": "iface_", "type": ["InterfaceT"], "visibility": "private" }, "saw-rpc_server-loopback-dat_srvs_": { "id": "saw-rpc_server-loopback-dat_srvs_", "name": "dat_srvs_", "type": ["DataServers"], "visibility": "private" } }, "functions": { "saw-rpc_server-loopback-get_class_id": { "id": "saw-rpc_server-loopback-get_class_id", "name": "get_class_id", "type": ["std::pair< uint32_t, uint32_t >"], "const": true, "override": true, "brief_description": "Returns the interface id." }, "saw-rpc_server-loopback-get_data_servers": { "id": "saw-rpc_server-loopback-get_data_servers", "name": "get_data_servers", "type": ["const DataServers &"], "const": true, "brief_description": "The data servers this rpc server moves its parameters and responses through." }, "saw-rpc_server-loopback-call-1": { "id": "saw-rpc_server-loopback-call-1", "name": "call", "type": ["error_or< id< ResponseT > >"], "brief_description": "Calls a function and lets the server decide where the response is stored.", "detailed_description": [ [ "A client cannot know which ids are free without asking, so this is the variant which costs no roundtrip beforehand." ], [ "The slot is picked after the function returned, which is the latest and therefore most accurate moment." ] ], "templates": [ { "name": "Lit", "kind": "non_type", "type": "string_literal", "brief_description": "Name of the interface member to call." } ], "parameters": [ { "name": "id_param", "type": ["id< typename schema_member_type< Lit, Iface >::type::RequestT >"], "brief_description": "Id of a value already sitting in the request data server." } ] }, "saw-rpc_server-loopback-call-2": { "id": "saw-rpc_server-loopback-call-2", "name": "call", "type": ["error_or< void >"], "brief_description": "Calls a function and stores the response in a slot allocated beforehand.", "detailed_description": [ [ "Meant for backends where the output exists before the call, such as a device buffer allocated on the remote." ] ], "templates": [ { "name": "Lit", "kind": "non_type", "type": "string_literal", "brief_description": "Name of the interface member to call." } ], "parameters": [ {"name": "id_param", "type": ["id< typename schema_member_type< Lit, Iface >::type::RequestT >"]}, { "name": "id_resp", "type": ["id< typename schema_member_type< Lit, Iface >::type::ResponseT >"], "brief_description": "Slot the answer has to end up in." } ] }, "saw-rpc_server-loopback-call_by_id-1": { "id": "saw-rpc_server-loopback-call_by_id-1", "name": "call_by_id", "type": ["error_or< uint64_t >"], "brief_description": "Calls a function which is only known at runtime.", "detailed_description": [ [ "The entry point for every backend which transports the call itself. The ids are untyped here, since such a backend only knows the function id and a number." ], [ "The id the response ended up in is meant to travel back in the reply. Fails with not_found if no interface member carries that function id." ] ], "parameters": [ { "name": "func_id", "type": ["uint32_t"], "brief_description": "rpc_function_id of the member name." }, {"name": "id_param", "type": ["uint64_t"]} ] }, "saw-rpc_server-loopback-call_by_id-2": { "id": "saw-rpc_server-loopback-call_by_id-2", "name": "call_by_id", "type": ["error_or< void >"], "brief_description": "Runtime call into a slot the caller allocated beforehand.", "parameters": [ {"name": "func_id", "type": ["uint32_t"]}, {"name": "id_param", "type": ["uint64_t"]}, {"name": "id_resp", "type": ["uint64_t"]} ] } }, "notes": [ "Copy and move are forbidden, because the remote holds a pointer to this object while it is registered." ] }