Cogs.Core
|
Default page type that maintains storage for elements of type T in the pool page and provides pooled allocations for this type. More...
#include <ConfigurablePagedPool.h>
Public Member Functions | |
DefaultPage ()=default | |
Default constructor. | |
DefaultPage (DefaultContext &context, size_t pageSize) | |
Construct a new page with the given page size. | |
T * | getHead () |
Retrieve a pointer to the first element of the page. | |
Private Attributes | |
std::vector< uint8_t > | bytes |
Backing storage bytes. | |
Default page type that maintains storage for elements of type T in the pool page and provides pooled allocations for this type.
T | Type of element to store in the pool page. For each page, sizeof(T) * pageSize bytes will be reserved as backing storage. |
Definition at line 31 of file ConfigurablePagedPool.h.
|
inline |
Construct a new page with the given page size.
context | Default allocation context (ignored). |
pageSize | Number of elements per page. |
Definition at line 42 of file ConfigurablePagedPool.h.
References Cogs::Collections::DefaultPage< T >::bytes, and Cogs::Collections::ItemHeader::next.
|
inline |
Retrieve a pointer to the first element of the page.
Definition at line 67 of file ConfigurablePagedPool.h.
References Cogs::Collections::DefaultPage< T >::bytes.
|
private |
Backing storage bytes.
Definition at line 71 of file ConfigurablePagedPool.h.
Referenced by Cogs::Collections::DefaultPage< T >::DefaultPage(), and Cogs::Collections::DefaultPage< T >::getHead().