.. _program_listing_file_BackendLibfabric_ActiveEndpoint.hpp: Program Listing for File ActiveEndpoint.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``BackendLibfabric/ActiveEndpoint.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef NETIO3BACKEND_BACKENDLIBFABRIC_ACTIVEENDPOINT_HPP #define NETIO3BACKEND_BACKENDLIBFABRIC_ACTIVEENDPOINT_HPP #include #include #include #include "Helpers.hpp" #include "netio3-backend/Netio3Backend.hpp" namespace netio3::libfabric { class ActiveEndpoint { public: ActiveEndpoint(EndPointAddress remote_address, NetworkMode mode, EndpointCapabilities capabilities, fid_fabric* fabric, fid_domain* domain, FiInfoUniquePtr&& info, fid_ep* shx_ctx = nullptr, fid_av* av = nullptr); ActiveEndpoint(EndPointAddress address, std::optional local_address, NetworkMode mode, EndpointCapabilities capabilities, fid_fabric* fabric, fid_domain* domain, fid_ep* shx_ctx = nullptr, fid_av* av = nullptr); enum class ConnectionMode { Connect, Accept }; void complete_connection(ConnectionMode mode, fid_pep* pep = nullptr); void update_addresses(); [[nodiscard]] const Endpoint& get_endpoint() const { return m_ep; } [[nodiscard]] Endpoint& get_endpoint() { return m_ep; } [[nodiscard]] const EndPointAddress& get_address() const { return m_address; } [[nodiscard]] const EndPointAddress& get_local_address() const { return m_local_address; } [[nodiscard]] const EndpointCapabilities& get_capabilities() const { return m_capabilities; } [[nodiscard]] CqCmFds get_cq_cm_fds() const { return {m_ep.cqfd, m_ep.rcqfd, m_ep.eqfd}; } void set_cq_ev_ctx(EventContext ctx) { m_cq_ev_ctx = std::move(ctx); } void set_rcq_ev_ctx(EventContext ctx) { m_rcq_ev_ctx = std::move(ctx); } void set_eq_ev_ctx(EventContext ctx) { m_eq_ev_ctx = std::move(ctx); } [[nodiscard]] const EventContext& get_eq_ev_ctx() const { return m_eq_ev_ctx; } [[nodiscard]] const EventContext& get_cq_ev_ctx() const { return m_cq_ev_ctx; } [[nodiscard]] const EventContext& get_rcq_ev_ctx() const { return m_rcq_ev_ctx; } private: [[nodiscard]] Endpoint create_endpoint(fid_fabric* fabric, fid_domain* domain, NetworkMode mode, FiInfoUniquePtr&& info, std::optional local_address, fid_ep* shx_ctx, fid_av* av); void open_endpoint(Endpoint& ep, fid_fabric* fabric, fid_domain* domain, fi_info* info); void bind_av(Endpoint& ep, fid_av* av) const; void enable_endpoint(Endpoint& ep); [[nodiscard]] static fi_cq_attr prepare_cq_attr(); void open_cq(Endpoint& ep, fid_domain* domain); void bind_srx_context(Endpoint& ep, fid_ep* shx_ctx) const; [[nodiscard]] static FiInfoUniquePtr get_info( const EndPointAddress& remote_address, const std::optional& local_address, NetworkMode mode); EndPointAddress m_address{}; EndPointAddress m_local_address{}; EndpointCapabilities m_capabilities{}; Endpoint m_ep{}; EventContext m_eq_ev_ctx{}; EventContext m_cq_ev_ctx{}; EventContext m_rcq_ev_ctx{}; }; } // namespace netio3::libfabric #endif // NETIO3BACKEND_BACKENDLIBFABRIC_ACTIVEENDPOINT_HPP