|
MXL : Media eXchange Layer
MXL
|
Owning, type-safe representation of a libfabric address. More...
#include <FabricAddress.hpp>
Public Types | |
| using | Native |
Public Member Functions | |
| FabricAddressFormat | addressFormat () const noexcept |
| Return the libfabric address format constant (FI_SOCKADDR_IN, etc.). | |
| bool | empty () const noexcept |
| True if the address could not be decoded (holds std::monostate). | |
| FabricAddress () noexcept | |
| Native const & | native () const noexcept |
| Access the underlying variant. | |
| std::optional< std::string > | node () const |
| Return the host portion of the address as a string. | |
| std::optional< std::string > | service () const |
| Return the service/port portion of the address as a string. | |
| std::string | toString () const |
| Format the address exactly as libfabric's internal ofi_straddr. | |
Static Public Member Functions | |
| static FabricAddress | decode (FabricAddressFormat addrFormat, void const *addr, std::size_t len) |
| Decode a raw libfabric address buffer of the given addr_format. | |
| static FabricAddress | fromDestination (FabricInfoView info) noexcept |
Build a FabricAddress from the destination address of info. | |
| static FabricAddress | fromSource (FabricInfoView info) noexcept |
Build a FabricAddress from the source address of info. | |
| static FabricAddress | parse (Provider provider, std::optional< std::string > node, std::optional< std::string > service) |
| Parse a node/service pair into a typed address for the given provider. | |
Private Member Functions | |
| FabricAddress (Native native) noexcept | |
Private Attributes | |
| Native | _native |
Owning, type-safe representation of a libfabric address.
Wraps the native address types that the various addr_format values map to. The address bytes are copied out of the source fi_info on construction, so a FabricAddress remains valid independently of the FabricInfoView it was built from.
An empty / unsupported / unrecognised address is represented by std::monostate.
Definition at line 76 of file FabricAddress.hpp.
Definition at line 79 of file FabricAddress.hpp.
|
noexcept |
Definition at line 225 of file FabricAddress.cpp.
|
explicitprivatenoexcept |
Definition at line 229 of file FabricAddress.cpp.
|
nodiscardnoexcept |
Return the libfabric address format constant (FI_SOCKADDR_IN, etc.).
Definition at line 379 of file FabricAddress.cpp.
|
staticnodiscard |
Decode a raw libfabric address buffer of the given addr_format.
| addrFormat | One of the libfabric FI_ADDR_* / FI_SOCKADDR* constants. |
| addr | Pointer to the address bytes, or nullptr. |
| len | Length of the address buffer in bytes. |
Definition at line 243 of file FabricAddress.cpp.
|
inlinenodiscardnoexcept |
True if the address could not be decoded (holds std::monostate).
Definition at line 114 of file FabricAddress.hpp.
|
staticnodiscardnoexcept |
Build a FabricAddress from the destination address of info.
Definition at line 238 of file FabricAddress.cpp.
|
staticnodiscardnoexcept |
Build a FabricAddress from the source address of info.
Definition at line 233 of file FabricAddress.cpp.
|
inlinenodiscardnoexcept |
Access the underlying variant.
Definition at line 107 of file FabricAddress.hpp.
|
nodiscard |
Return the host portion of the address as a string.
For the socket address types this is the textual IP address; for the IB and EFA types it is the GID. For an FI_ADDR_STR address it is the address string itself, and for an empty address it is the empty string.
Definition at line 343 of file FabricAddress.cpp.
|
staticnodiscard |
Parse a node/service pair into a typed address for the given provider.
Definition at line 393 of file FabricAddress.cpp.
|
nodiscard |
Return the service/port portion of the address as a string.
Definition at line 361 of file FabricAddress.cpp.
|
nodiscard |
Format the address exactly as libfabric's internal ofi_straddr.
Returns an empty string for an empty / undecodable address (mirroring ofi_straddr returning NULL).
Definition at line 325 of file FabricAddress.cpp.
|
private |
Definition at line 152 of file FabricAddress.hpp.