1#ifndef IPPL_BUFFER_HANDLER_HPP
2#define IPPL_BUFFER_HANDLER_HPP
6 template <
typename MemorySpace>
9 template <
typename MemorySpace>
26 template <
typename MemorySpace>
33 template <
typename MemorySpace>
42 template <
typename MemorySpace>
51 template <
typename MemorySpace>
57 template <
typename MemorySpace>
63 template <
typename MemorySpace>
66 if (lhs->getBufferSize() != rhs->getBufferSize()) {
67 return lhs->getBufferSize() < rhs->getBufferSize();
74 template <
typename MemorySpace>
79 template <
typename MemorySpace>
90 template <
typename MemorySpace>
100 template <
typename MemorySpace>
101 typename DefaultBufferHandler<MemorySpace>::buffer_set_type::iterator
105 return buffer->getBufferSize() >= requiredSize;
109 template <
typename MemorySpace>
120 template <
typename MemorySpace>
130 buffer->reallocBuffer(requiredSize);
136 template <
typename MemorySpace>
139 buffer_type newBuffer = std::make_shared<archive_type>(requiredSize);
ippl::detail::size_type size_type
std::shared_ptr< archive_type > buffer_type
void releaseUsedBuffer(buffer_type buffer)
buffer_type reallocateLargestFreeBuffer(size_type requiredSize)
size_type freeSize_m
Total size of all free buffers.
size_type usedSize_m
Total size of all allocated buffers.
buffer_type getFreeBuffer(buffer_type buffer)
size_type getUsedSize() const override
Frees a specified buffer.
buffer_set_type used_buffers
Set of used buffers.
void deleteAllBuffers() override
Frees a specified buffer.
~DefaultBufferHandler() override
bool isBufferUsed(buffer_type buffer) const
static bool bufferSizeComparator(const buffer_type &lhs, const buffer_type &rhs)
buffer_type findFreeBuffer(size_type requiredSize)
void freeBuffer(buffer_type buffer) override
Frees a specified buffer.
buffer_type getBuffer(size_type size, double overallocation) override
Acquires a buffer of at least the specified size.
buffer_type allocateNewBuffer(size_type requiredSize)
void freeAllBuffers() override
Frees a specified buffer.
buffer_set_type::iterator findSmallestSufficientBuffer(size_type requiredSize)
buffer_set_type free_buffers
Set of free buffers.
size_type getFreeSize() const override
Frees a specified buffer.