6 #ifndef KAGOME_MESSAGE_POOL_HPP 7 #define KAGOME_MESSAGE_POOL_HPP 13 #include <unordered_set> 15 #include <boost/asio/buffer.hpp> 51 MessagePool(std::size_t entry_size_bytes, std::size_t entries_count);
62 std::optional<MessageHandle>
push(
const std::string &message,
114 #endif // KAGOME_MESSAGE_POOL_HPP std::vector< uint8_t > data
std::unordered_set< std::size_t > free_slots_
RefCount release(MessageHandle handle)
std::size_t capacity() const
std::optional< MessageHandle > push(const std::string &message, int16_t ref_count)
const std::size_t entry_size_
std::optional< MessageHandle > nextFreeSlot()
performs quick lookup for a free slot
const std::size_t entries_count_
boost::asio::mutable_buffer operator[](MessageHandle handle) const
std::vector< Record > pool_
std::size_t MessageHandle
RefCount add_ref(MessageHandle handle)
MessagePool(std::size_t entry_size_bytes, std::size_t entries_count)