Template Class Reservation

Class Documentation

template<typename T, typename Allocator = ::CE::Memory::Allocators::ObjectPoolAllocator<T>>
class Reservation

Requires: ReservationAllocator<Allocator, T>

Reserves one CE::Memory::Block and tracks only its unclaimed ranges.

emplace() splits out a slot and gives its handle the release context; the handle may outlive this reservation. Failed construction leaves the slot reserved, while the destructor returns remaining contiguous ranges to the manager.

Public Functions

inline explicit Reservation(std::size_t count, Allocator allocator = {})
Reservation(const Reservation&) = delete
Reservation &operator=(const Reservation&) = delete
inline Reservation(Reservation &&other) noexcept
Reservation &operator=(Reservation&&) = delete
inline ~Reservation() noexcept
inline const std::vector<::CE::Memory::Block<T>> &remaining_ranges() const noexcept

Declaration: [[nodiscard]]

inline std::size_t size() const noexcept

Declaration: [[nodiscard]]

template<typename ...Args>
inline std::shared_ptr<T> emplace(std::size_t index, Args&&... args)

Construct one slot and transfer it to a handle retaining the release context.

If construction fails, the slot stays in remaining_ranges().