MCPcopy Create free account
hub / github.com/AimRT/AimRT / Invoke

Method Invoke

src/interface/aimrt_module_cpp_interface/rpc/rpc_handle.h:327–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 protected:
326 template <class ReqType, class RspType>
327 aimrt::rpc::Status Invoke(
328 std::string_view full_func_name,
329 aimrt::rpc::ContextRef ctx_ref,
330 const ReqType& req,
331 RspType& rsp) {
332 std::promise<aimrt::rpc::Status> result_promise;
333
334 if (ctx_ref) {
335 ctx_ref.SetFunctionName(full_func_name);
336
337 rpc_handle_ref_.Invoke(
338 full_func_name, ctx_ref, &req, &rsp,
339 [&result_promise](uint32_t code) {
340 result_promise.set_value(aimrt::rpc::Status(code));
341 });
342
343 return result_promise.get_future().get();
344 }
345
346 auto ctx_ptr = NewContextSharedPtr();
347 ctx_ptr->SetFunctionName(full_func_name);
348
349 rpc_handle_ref_.Invoke(
350 full_func_name, *ctx_ptr, &req, &rsp,
351 [&result_promise](uint32_t code) {
352 result_promise.set_value(aimrt::rpc::Status(code));
353 });
354
355 return result_promise.get_future().get();
356 }
357};
358
359class AsyncProxyBase : public ProxyBase {

Callers

nothing calls this directly

Calls 3

StatusClass · 0.85
SetFunctionNameMethod · 0.45
InvokeMethod · 0.45

Tested by

no test coverage detected