CARLA
Static Public Member Functions | List of all members
carla::rpc::detail::FunctionWrapper< R(*)(Args...)> Struct Template Reference

#include <Server.h>

+ Inheritance diagram for carla::rpc::detail::FunctionWrapper< R(*)(Args...)>:

Static Public Member Functions

template<typename FuncT >
static auto WrapAsyncCall (FuncT &&functor)
 Wraps functor into a function type with equivalent signature that handles the metadata sent by the client. More...
 
template<typename FuncT >
static auto WrapSyncCall (boost::asio::io_context &io, FuncT &&functor)
 Wraps functor into a function type with equivalent signature. More...
 

Detailed Description

template<typename R, typename... Args>
struct carla::rpc::detail::FunctionWrapper< R(*)(Args...)>

Definition at line 97 of file rpc/Server.h.

Member Function Documentation

◆ WrapAsyncCall()

template<typename R , typename... Args>
template<typename FuncT >
static auto carla::rpc::detail::FunctionWrapper< R(*)(Args...)>::WrapAsyncCall ( FuncT &&  functor)
inlinestatic

Wraps functor into a function type with equivalent signature that handles the metadata sent by the client.

If the client called this method asynchronously, the result is ignored.

Definition at line 131 of file rpc/Server.h.

References carla::rpc::Metadata::IsResponseIgnored().

+ Here is the call graph for this function:

◆ WrapSyncCall()

template<typename R , typename... Args>
template<typename FuncT >
static auto carla::rpc::detail::FunctionWrapper< R(*)(Args...)>::WrapSyncCall ( boost::asio::io_context &  io,
FuncT &&  functor 
)
inlinestatic

Wraps functor into a function type with equivalent signature.

The wrap function returned. When called, posts functor into the io_context; if the client called this method synchronously, waits for the posted task to finish, otherwise returns immediately.

This way, no matter from which thread the wrap function is called, the functor provided is always called from the context of the io_context. I.e., we can use the io_context to run tasks on a specific thread (e.g. game thread).

Definition at line 109 of file rpc/Server.h.

References carla::rpc::Metadata::IsResponseIgnored(), and carla::MoveHandler().

+ Here is the call graph for this function:

The documentation for this struct was generated from the following file: