Class SendBufferManager
Defined in File SendBufferManager.hpp
Class Documentation
-
class SendBufferManager
Manages send buffers for buffered sending.
The SendBufferManager class is responsible for managing a set of buffers that can be used for buffered sending. It allocates and registers the buffers as memory regions, provides access to the buffers, and tracks the number of available buffers.
Public Functions
-
SendBufferManager(ConnectionParametersSendBuffered connection_params, DomainManager &domain_manager)
Constructs a SendBufferManager object.
- Parameters:
connection_params – The connection parameters used to configure the buffers
domain_manager – The domain manager to use for buffer registration
-
SendBufferManager(const SendBufferManager&) = delete
-
SendBufferManager(SendBufferManager&&) = delete
-
SendBufferManager &operator=(const SendBufferManager&) = delete
-
SendBufferManager &operator=(SendBufferManager&&) = delete
-
~SendBufferManager()
Destroys the SendBufferManager object.
Unregister the buffers.
-
inline NetworkBuffer *get_buffer()
Retrieves a network buffer.
If no buffers are available, returns nullptr.
@important Check that returned buffer is not null.
- Throws:
NoBuffersAllocated – if no buffers were allocated
- Returns:
A pointer to the network buffer (or null of none available)
-
inline std::uint64_t release_buffer(std::uint64_t bufnum)
Marks the buffer with the specified buffer number as available for reuse.
- Parameters:
bufnum – The buffer number to release
- Returns:
The key (is equal to buffer number for buffered sending)
-
std::size_t get_num_available_buffers()
Retrieves the number of available buffers.
Returns the mininum number of available buffers since the last call to this function.
- Returns:
The number of available buffers
-
SendBufferManager(ConnectionParametersSendBuffered connection_params, DomainManager &domain_manager)