MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
Fabric.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Contributors to the Media eXchange Layer project.
2//
3// SPDX-License-Identifier: Apache-2.0
4
5#pragma once
6
7#include <memory>
8#include <rdma/fabric.h>
9#include "FabricInfo.hpp"
10
12{
13
16 class Fabric
17 {
18 public:
19 ~Fabric();
20
21 Fabric(Fabric const&) = delete;
22 void operator=(Fabric const&) = delete;
23
24 Fabric(Fabric&&) noexcept;
25 Fabric& operator=(Fabric&&);
26
29 [[nodiscard]]
30 ::fid_fabric* raw() noexcept;
33 [[nodiscard]]
34 ::fid_fabric const* raw() const noexcept;
35
41 static std::shared_ptr<Fabric> open(FabricInfoView info);
42
45 [[nodiscard]]
46 FabricInfoView info() const noexcept;
47
48 private:
51 void close();
52
53 Fabric(::fid_fabric* raw, FabricInfoView info);
54
55 private:
56 ::fid_fabric* _raw;
58 };
59
60}
Non-owning view of a FabricInfo. Returned when iterating over a FabricInfoList.
Fabric(Fabric const &)=delete
void close()
Close the underlying fabric object.
Definition Fabric.cpp:75
static std::shared_ptr< Fabric > open(FabricInfoView info)
Open a fabric object based on the provided FabricInfoView.
Definition Fabric.cpp:15
void operator=(Fabric const &)=delete
::fid_fabric * raw() noexcept
Mutable accessor for the underlying raw libfabric fabric object.
Definition Fabric.cpp:60
FabricInfoView info() const noexcept
Get a view on the libfabric info used to open this fabric.
Definition Fabric.cpp:70
FabricInfo(FabricInfoView) noexcept
Create an owning FabricInfo object from a non-owning view.