MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
PassiveEndpoint.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 <rdma/fi_endpoint.h>
8#include "Address.hpp"
9#include "Endpoint.hpp"
10#include "Event.hpp"
11#include "EventQueue.hpp"
12#include "Fabric.hpp"
13
15{
21 {
22 public:
24
25 // Copy constructor and assignment operators are deleted
27 void operator=(PassiveEndpoint const&) = delete;
28
29 // Implement move constructor and assignment operator
31 PassiveEndpoint& operator=(PassiveEndpoint&&);
32
38 [[nodiscard]]
39 static PassiveEndpoint create(std::shared_ptr<Fabric> fabric);
40
46 [[nodiscard]]
47 static PassiveEndpoint create(std::shared_ptr<Fabric> fabric, Endpoint::Id id);
48
51 [[nodiscard]]
52 Endpoint::Id id() const noexcept;
53
61 void bind(std::shared_ptr<EventQueue> eq);
62
65 void listen();
66
71 void reject(Event& entry);
72
78 [[nodiscard]]
79 std::shared_ptr<EventQueue> eventQueue() const;
80
83 [[nodiscard]]
85 {
86 return RawFabricAddress::fromFid(&_raw->fid, _fabric->info());
87 }
88
91 [[nodiscard]]
92 ::fid_pep* raw() noexcept;
93
96 [[nodiscard]]
97 ::fid_pep const* raw() const noexcept;
98
99 private:
102 void close();
109 PassiveEndpoint(::fid_pep* raw, std::shared_ptr<Fabric> fabric, Endpoint::Id id,
110 std::optional<std::shared_ptr<EventQueue>> eq = std::nullopt);
111
112 private:
113 ::fid_pep* _raw;
114 std::shared_ptr<Fabric> _fabric;
116
117 std::optional<std::shared_ptr<EventQueue>> _eq;
118 };
119}
RAII Wrapper around a libfabric endpoint (fi_ep).
Definition Endpoint.hpp:29
RAII Wrapper around a libfabric event queue (fi_eq).
Type to represent an event entry from an EventQueue.
Definition Event.hpp:21
RAIII wrapper around a libfabric fabric object (fid_fabric).
Definition Fabric.hpp:17
RAII Wrapper around a libfabric passive endpoint (fid_pep).
std::shared_ptr< EventQueue > eventQueue() const
Accessor for the associated event queue.
std::optional< std::shared_ptr< EventQueue > > _eq
RawFabricAddress localAddress()
Obtain the local fabric address for this passive endpoint.
void bind(std::shared_ptr< EventQueue > eq)
Bind the endpoint to an event queue.
::fid_pep * raw() noexcept
Access the underlying raw fid_pep pointer.
void operator=(PassiveEndpoint const &)=delete
static PassiveEndpoint create(std::shared_ptr< Fabric > fabric)
Allocate a new PassiveEndpoint associated with the given Fabric.
void reject(Event &entry)
Reject a connection request event.
PassiveEndpoint(PassiveEndpoint const &)=delete
void listen()
Put the passive endpoint into listening mode.
void close()
Releases all underlying resources. This is called from the destructor and the move-assignment operato...
Wrapper around a libfabric endpoint address.
Definition Address.hpp:20
static RawFabricAddress fromFid(::fid_t fid, FabricInfoView info)
Retrieve the fabric address of an endpoint by passing its fid.
Definition Address.cpp:27
::fi_info * raw() noexcept
Returns the raw fi_info object managed by this FabricInfo instance.