.. _program_listing_file_BackendLibfabric_SendEndpointBuffered.hpp: Program Listing for File SendEndpointBuffered.hpp ================================================= |exhale_lsh| :ref:`Return to documentation for file ` (``BackendLibfabric/SendEndpointBuffered.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef NETIO3BACKEND_BACKENDLIBFABRIC_SENDENDPOINTBUFFERED_HPP #define NETIO3BACKEND_BACKENDLIBFABRIC_SENDENDPOINTBUFFERED_HPP #include #include #include #include #include "ActiveEndpoint.hpp" #include "DomainManager.hpp" #include "SendBufferManager.hpp" #include "Sender.hpp" #include "netio3-backend/Netio3Backend.hpp" #include "netio3-backend/NetworkBuffer.hpp" namespace netio3::libfabric { class SendEndpointBuffered { public: SendEndpointBuffered(ActiveEndpoint& endpoint, const ConnectionParametersSendBuffered& connection_params, std::optional& shared_buffer_manager, DomainManager& domain_manager); [[nodiscard]] auto operator<=>(const SendEndpointBuffered& other) const { return m_endpoint.get().get_endpoint().ep <=> other.m_endpoint.get().get_endpoint().ep; } [[nodiscard]] const ActiveEndpoint& get_active_endpoint() const { return m_endpoint.get(); } [[nodiscard]] ActiveEndpoint& get_active_endpoint() { return m_endpoint.get(); } NetworkBuffer* get_buffer() { return m_buffer_manager_ptr->get_buffer(); } NetioStatus send_buffer(Buffer* buffer, std::size_t size, fi_addr_t addr = 0) const { ZoneScoped; iovec iov{}; iov.iov_base = buffer->data().data(); iov.iov_len = size; return m_sender.send_data(iov, buffer->mr, buffer->get_key(), addr); } [[nodiscard]] std::uint64_t release_buffer(std::uint64_t bufnum) { return m_buffer_manager_ptr->release_buffer(bufnum); } [[nodiscard]] std::size_t get_num_available_buffers(); [[nodiscard]] std::vector get_pending_sends() const { return {}; } private: [[nodiscard]] ConnectionParametersSendBuffered prepare_connection_parameters( const ConnectionParametersSendBuffered& requested) const; [[nodiscard]] std::optional create_buffer_manager( const ConnectionParametersSendBuffered& connection_params, DomainManager& domain_manager) const; std::reference_wrapper m_endpoint; Sender m_sender; std::optional m_buffer_manager; SendBufferManager* m_buffer_manager_ptr{nullptr}; }; } // namespace netio3::libfabric #endif // NETIO3BACKEND_BACKENDLIBFABRIC_SENDENDPOINTBUFFERED_HPP