xgboost
命名空间 | | 枚举 | 函数
xgboost::collective 命名空间参考

命名空间

 detail
 

结构体  Result
 一种比抛出 dmlc 异常更容易处理的错误类型。我们可以记录和传播系统错误代码。 更多...
 
类  SockAddrV6
 
类  SockAddrV4
 
类  SockAddress
 TCP socket 地址,可以是 IPv4 或 IPv6。 更多...
 
类  TCPSocket
 用于简单通信的 TCP socket。 更多...
 

枚举

枚举类  SockDomain : std::int32_t { kV4 = AF_INET , kV6 = AF_INET6 }
 

函数

Result operator+ (Result &&lhs, Result &&rhs)
 
auto Success () noexcept(true)
 返回成功。 更多...
 
auto Fail (std::string msg, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE())
 返回失败。 更多...
 
auto Fail (std::string msg, std::error_code errc, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE())
 返回带有 errno 的失败。 更多...
 
auto Fail (std::string msg, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE())
 返回带有先前错误的失败。 更多...
 
auto Fail (std::string msg, std::error_code errc, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE())
 返回带有先前错误和新 errno 的失败。 更多...
 
template<typename Fn >
std::enable_if_t< std::is_invocable_v< Fn >, Resultoperator<< (Result &&r, Fn &&fn)
 
void SafeColl (Result const &rc)
 
SockAddress MakeSockAddress (StringView host, in_port_t port)
 解析主机地址并返回 SockAddress 实例。支持 IPv4 和 IPv6 主机。 更多...
 
Result Connect (xgboost::StringView host, std::int32_t port, std::int32_t retry, std::chrono::seconds timeout, xgboost::collective::TCPSocket *out_conn)
 连接到远程地址,失败时返回错误代码。 更多...
 
Result GetHostName (std::string *p_out)
 获取本地主机名。 更多...
 
template<typename H >
Result INetNToP (H const &host, std::string *p_out)
 inet_ntop 更多...
 

详细描述

版权所有 2023-2024, XGBoost 贡献者

枚举类型文档

◆ SockDomain

枚举 xgboost::collective::SockDomain : std::int32_t
强类型
枚举成员
kV4 
kV6 

函数文档

◆ Connect()

Result xgboost::collective::Connect ( xgboost::StringView  host,
std::int32_t  port,
std::int32_t  retry,
std::chrono::seconds  timeout,
xgboost::collective::TCPSocket out_conn 
)

连接到远程地址,失败时返回错误代码。

参数
host主机 IP 地址。
port连接端口。
retry尝试重试的次数。
timeout每次连接尝试的超时时间。
out_conn如果连接成功,则输出 socket。如果连接失败, 无效且未定义。
返回值
连接状态。

◆ Fail() [1/4]

auto xgboost::collective::Fail ( std::string  msg,
char const *  file = __builtin_FILE(),
std::int32_t  line = __builtin_LINE() 
)
内联

返回失败。

◆ Fail() [2/4]

auto xgboost::collective::Fail ( std::string  msg,
Result &&  prev,
char const *  file = __builtin_FILE(),
std::int32_t  line = __builtin_LINE() 
)
内联

返回带有先前错误的失败。

◆ Fail() [3/4]

auto xgboost::collective::Fail ( std::string  msg,
std::error_code  errc,
char const *  file = __builtin_FILE(),
std::int32_t  line = __builtin_LINE() 
)
内联

返回带有 errno 的失败。

◆ Fail() [4/4]

auto xgboost::collective::Fail ( std::string  msg,
std::error_code  errc,
Result &&  prev,
char const *  file = __builtin_FILE(),
std::int32_t  line = __builtin_LINE() 
)
内联

返回带有先前错误和新 errno 的失败。

◆ GetHostName()

Result xgboost::collective::GetHostName ( std::string *  p_out)

获取本地主机名。

◆ INetNToP()

template<typename H >
Result xgboost::collective::INetNToP ( H const &  host,
std::string *  host 
)

inet_ntop

◆ MakeSockAddress()

SockAddress xgboost::collective::MakeSockAddress ( StringView  host,
host  in_port_t 
)

port 

解析主机地址并返回 SockAddress 实例。支持 IPv4 和 IPv6 主机。

◆ operator+() ( Result &&  Result xgboost::collective::operator+,
Result &&  lhs
)
内联

rhs 

template<typename Fn >
◆ operator<<() ( Result &&  std::enable_if_t<std::is_invocable_v<Fn>, Result> xgboost::collective::operator<<,
r Fn && 
)

fn 

◆ SafeColl() ( void xgboost::collective::SafeColl Result const & )

rc

◆ Success() ( )
auto xgboost::collective::Success

内联noexcept