CARLA
 
载入中...
搜索中...
未找到
Public 成员函数 | Private 属性 | 所有成员列表
carla::rpc::Server类 参考

一个RPC服务器,可以将功能绑定为同步或异步运行。 更多...

#include <Server.h>

+ carla::rpc::Server 的协作图:

Public 成员函数

void AsyncRun (size_t worker_threads)
 
template<typename FunctorT >
void BindAsync (const std::string &name, FunctorT &&functor)
 
template<typename FunctorT >
void BindSync (const std::string &name, FunctorT &&functor)
 
template<typename... Args>
 Server (Args &&... args)
 
void Stop ()
 
void SyncRunFor (time_duration duration)
 

Private 属性

::rpc::server _server
 
boost::asio::io_context _sync_io_context
 

详细描述

一个RPC服务器,可以将功能绑定为同步或异步运行。

使用AsyncRun启动工作线程,使用SyncRunFor在调用者线程中运行一段工作。

使用BindAsync绑定的函数将在工作线程中异步运行。使用BindSync绑定的函数将在 SyncRunFor函数中运行。

在文件 rpc/Server.h34 行定义.

构造及析构函数说明

◆ Server()

template<typename ... Args>
carla::rpc::Server::Server ( Args &&... args)
inlineexplicit

在文件 rpc/Server.h153 行定义.

引用了 _server.

成员函数说明

◆ AsyncRun()

void carla::rpc::Server::AsyncRun ( size_t worker_threads)
inline

在文件 rpc/Server.h50 行定义.

引用了 _server.

◆ BindAsync()

template<typename FunctorT >
void carla::rpc::Server::BindAsync ( const std::string & name,
FunctorT && functor )
inline

在文件 rpc/Server.h169 行定义.

引用了 _server.

被这些函数引用 ServerBinder::operator<<().

+ 这是这个函数的调用关系图:

◆ BindSync()

template<typename FunctorT >
void carla::rpc::Server::BindSync ( const std::string & name,
FunctorT && functor )
inline

在文件 rpc/Server.h160 行定义.

引用了 _server , 以及 _sync_io_context.

被这些函数引用 ServerBinder::operator<<().

+ 这是这个函数的调用关系图:

◆ Stop()

void carla::rpc::Server::Stop ( )
inline
警告
不会停止游戏线程。

在文件 rpc/Server.h66 行定义.

引用了 _server.

◆ SyncRunFor()

void carla::rpc::Server::SyncRunFor ( time_duration duration)
inline

在文件 rpc/Server.h55 行定义.

引用了 _sync_io_context , 以及 carla::time_duration::to_chrono().

+ 函数调用图:

类成员变量说明

◆ _server

::rpc::server carla::rpc::Server::_server
private

在文件 rpc/Server.h74 行定义.

被这些函数引用 AsyncRun(), BindAsync(), BindSync(), Server() , 以及 Stop().

◆ _sync_io_context

boost::asio::io_context carla::rpc::Server::_sync_io_context
private

在文件 rpc/Server.h72 行定义.

被这些函数引用 BindSync() , 以及 SyncRunFor().


该类的文档由以下文件生成: