RMVL  2.5.0-dev
Robotic Manipulation and Vision Library
载入中...
搜索中...
未找到
rm::lpss::async::Client< SrvType > 模板类 参考final

异步客户端代理 更多...

#include <rmvl/lpss/node.hpp>

类 rm::lpss::async::Client< SrvType > 继承关系图:
rm::lpss::async::Client< SrvType > 的协作图:

Public 类型

using ptr = std::shared_ptr<Client<SrvType>>
using Request = typename SrvType::Request
using Response = typename SrvType::Response

Public 成员函数

bool invalid () const noexcept
 判断客户端是否无效
template<typename Rep, typename Period>
rm::async::Task< std::optional< Response > > call (const Request &request, std::chrono::duration< Rep, Period > timeout)
 调用服务并异步等待响应

友元

class Node

详细描述

template<typename SrvType>
class rm::lpss::async::Client< SrvType >

异步客户端代理

模板参数
SrvType服务类型,需提供 RequestResponse 类型别名
注解
首版仅允许每个客户端同时存在一个未完成调用,并发调用会返回 std::nullopt

成员类型定义说明

◆ ptr

template<typename SrvType>
using rm::lpss::async::Client< SrvType >::ptr = std::shared_ptr<Client<SrvType>>

◆ Request

template<typename SrvType>
using rm::lpss::async::Client< SrvType >::Request = typename SrvType::Request

◆ Response

template<typename SrvType>
using rm::lpss::async::Client< SrvType >::Response = typename SrvType::Response

成员函数说明

◆ call()

template<typename SrvType>
template<typename Rep, typename Period>
rm::async::Task< std::optional< Response > > rm::lpss::async::Client< SrvType >::call ( const Request & request,
std::chrono::duration< Rep, Period > timeout )

调用服务并异步等待响应

参数
[in]request请求消息
[in]timeout超时时间
返回
成功时返回响应,并发调用或等待超时时返回 std::nullopt

◆ invalid()

template<typename SrvType>
bool rm::lpss::async::Client< SrvType >::invalid ( ) const
inlinenoexcept

判断客户端是否无效

◆ Node

template<typename SrvType>
friend class Node
friend