Class Buffer
Defined in File Buffer.hpp
Inheritance Relationships
Base Type
public netio3::NetworkBuffer
(Class NetworkBuffer)
Class Documentation
-
class Buffer : public netio3::NetworkBuffer
Represents a buffer used for network communication.
This struct extends the NetworkBuffer struct and adds additional functionality. It contains a reference to a DomainContext object, a memory region pointer (mr), a key to be passed on the on_send_complete callback, and methods to retrieve the buffer and its size. It is used for buffered sending and for the data buffer for zero-copy sending.
Public Functions
-
inline Buffer(DomainContext &domain, const std::size_t size, const std::uint64_t key)
Constructs a Buffer object with the specified domain and size.
The domain is required to keep track of the number of registered MRs per domain.
- Parameters:
domain – The DomainContext object associated with the buffer
size – The size of the buffer
-
inline Buffer(DomainContext &domain, size_t size, std::uint8_t *buf)
Constructs a Buffer object with the specified domain, size, and buffer.
Uses the pre-allocated buffer.
- Parameters:
domain – The DomainContext object associated with the buffer
size – The size of the buffer
buf – A pointer to the buffer data
-
inline const std::uint8_t *get_buffer()
Returns a pointer to the buffer data.
- Returns:
A pointer to the buffer data
-
inline std::size_t get_size() const
Returns the size of the buffer.
- Returns:
The size of the buffer
-
inline DomainContext &get_domain()
Returns the domain.
- Returns:
Domain of the buffer
-
inline std::uint64_t get_key() const
Returns the key of the buffer.
- Returns:
The key of the buffer
Public Members
-
fid_mr *mr = {nullptr}
-
inline Buffer(DomainContext &domain, const std::size_t size, const std::uint64_t key)