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

命名空间

 详细信息
 

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

枚举

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

函数

结果 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, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE())
 
SockAddress MakeSockAddress (StringView host, in_port_t port)
 解析主机地址并返回 SockAddress 实例。支持 IPv4 和 IPv6 主机。更多...
 
结果 Connect (xgboost::StringView host, std::int32_t port, std::int32_t retry, std::chrono::seconds timeout, xgboost::collective::TCPSocket *out_conn)
 连接到远程地址,如果失败则返回错误代码。更多...
 
结果 GetHostName (std::string *p_out)
 获取本地主机名。更多...
 
template<typename H >
结果 INetNToP (H const &host, std::string *p_out)
 inet_ntop 更多...
 

详细描述

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

枚举类型文档

◆ SockDomain

enum 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如果连接成功,则为输出套接字。Value 在连接失败时无效且未定义。
返回
连接状态。

◆ Fail() [1/4]

auto xgboost::collective::Fail ( std::string  msg,
char const *  文件 = __builtin_FILE(),
std::int32_t  = __builtin_LINE() 
)
inline

返回失败。

◆ Fail() [2/4]

auto xgboost::collective::Fail ( std::string  msg,
结果 &&  prev,
char const *  文件 = __builtin_FILE(),
std::int32_t  = __builtin_LINE() 
)
inline

返回带前一个错误的失败。

◆ Fail() [3/4]

auto xgboost::collective::Fail ( std::string  msg,
std::error_code  errc,
char const *  文件 = __builtin_FILE(),
std::int32_t  = __builtin_LINE() 
)
inline

返回带 errno 的失败。

◆ Fail() [4/4]

auto xgboost::collective::Fail ( std::string  msg,
std::error_code  errc,
结果 &&  prev,
char const *  文件 = __builtin_FILE(),
std::int32_t  = __builtin_LINE() 
)
inline

返回带前一个错误和新 errno 的失败。

◆ GetHostName()

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

获取本地主机名。

◆ INetNToP()

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

inet_ntop

◆ MakeSockAddress()

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

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

◆ operator+()

Result xgboost::collective::operator+ ( 结果 &&  lhs,
结果 &&  rhs 
)
inline

◆ operator<<()

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

◆ SafeColl()

void xgboost::collective::SafeColl ( Result const &  rc,
char const *  文件 = __builtin_FILE(),
std::int32_t  = __builtin_LINE() 
)

◆ Success()

auto xgboost::collective::Success ( )
inlinenoexcept

返回成功。