MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
MemoryRegion.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 <cstdint>
8#include <sys/uio.h>
9#include <rdma/fabric.h>
10#include <rdma/fi_domain.h>
11#include "Domain.hpp"
12#include "Region.hpp"
13
15{
16
20 {
21 public:
35 static MemoryRegion reg(Domain& domain, Region const& region, std::uint64_t access);
36
38
39 MemoryRegion(MemoryRegion const&) = delete;
40 void operator=(MemoryRegion const&) = delete;
41
42 MemoryRegion(MemoryRegion&&) noexcept;
43 MemoryRegion& operator=(MemoryRegion&&) noexcept;
44
47 [[nodiscard]]
48 ::fid_mr* raw() noexcept;
50 [[nodiscard]]
51 ::fid_mr const* raw() const noexcept;
52
55 [[nodiscard]]
56 void* desc() const noexcept;
57
63 [[nodiscard]]
64 std::uint64_t rkey() const noexcept;
65
66 private:
67 friend class RegisteredRegion;
68
69 private:
72 void close();
73
74 MemoryRegion(::fid_mr* raw);
75
76 private:
77 ::fid_mr* _raw;
78 };
79}
RAII Wrapper around a libfabric domain (fi_domain).
Definition Domain.hpp:24
void operator=(MemoryRegion const &)=delete
static MemoryRegion reg(Domain &domain, Region const &region, std::uint64_t access)
Register a memory region with a specified domain and access permissions.
void close()
Internal method to release the memory region.
::fid_mr * raw() noexcept
Access the underlying raw fid_mr pointer.
void * desc() const noexcept
Get the descriptor associated with the memory region.
std::uint64_t rkey() const noexcept
Get the remote key (rkey) associated with the memory region.
MemoryRegion(MemoryRegion const &)=delete
Represent a memory region (unregistered).
Definition Region.hpp:24