|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
Interface for memory buffer handling. More...
#include <BufferHandler.h>
Inheritance diagram for ippl::BufferHandler< MemorySpace >:Public Types | |
| using | archive_type = ippl::detail::Archive< MemorySpace > |
| using | buffer_type = std::shared_ptr< archive_type > |
| using | size_type = ippl::detail::size_type |
Public Member Functions | |
| virtual buffer_type | getBuffer (size_type size, double overallocation)=0 |
| Requests a memory buffer of a specified size. | |
| virtual void | freeBuffer (buffer_type buffer)=0 |
| Frees a specified buffer. | |
| virtual void | freeAllBuffers ()=0 |
| Frees all currently used buffers. | |
| virtual void | deleteAllBuffers ()=0 |
| Deletes all buffers. | |
| virtual size_type | getUsedSize () const =0 |
| Gets the size of all buffers in use. | |
| virtual size_type | getFreeSize () const =0 |
| Gets the size of all free buffers. | |
Interface for memory buffer handling.
Defines methods for acquiring, freeing, and managing memory buffers. Implementations are responsible for managing buffers efficiently, ensuring that allocated buffers are reused where possible.
| MemorySpace | The memory space type used for buffer allocation. |
|
pure virtual |
Deletes all buffers.
Releases all allocated memory buffers, both used and free. After this call, no buffers are available until new allocations.
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.
|
pure virtual |
Frees all currently used buffers.
Transfers all used buffers to the free state, making them available for reuse. This does not deallocate memory but resets buffer usage.
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.
|
pure virtual |
Frees a specified buffer.
Moves the specified buffer to a free state, making it available for reuse in future buffer requests.
| buffer | The buffer to be freed. |
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.
|
pure virtual |
Requests a memory buffer of a specified size.
Provides a buffer of at least the specified size, with the option to allocate additional space based on an overallocation multiplier. This function attempts to reuse available buffers if possible.
| size | The required size of the buffer, in bytes. |
| overallocation | A multiplier to allocate extra space, which may help avoid frequent reallocation in some use cases. |
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.
|
pure virtual |
Gets the size of all free buffers.
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.
|
pure virtual |
Gets the size of all buffers in use.
Implemented in ippl::DefaultBufferHandler< MemorySpace >, and ippl::LoggingBufferHandler< MemorySpace >.