24 : fMemory(nullptr), fPageSize(pageSize), fNPages(nPages)
44 for (std::size_t i = 0; i < fNPages; ++i) {
45 if (fPages[i].IsNull()) {
46 void* buffer =
static_cast<unsigned char *
>(fMemory) + (fPageSize * i);
59 for (
unsigned i = 0; i < fNPages; ++i) {
60 if (fPages[i] == page) {
71 for (
unsigned i = 0; i < fNPages; ++i) {
72 if (fPages[i] == page) {
73 if (--fReferences[i] == 0) {
84 for (
unsigned i = 0; i < fNPages; ++i) {
85 if (fReferences[i] == 0)
continue;
87 if (!fPages[i].Contains(index))
continue;
91 RPage newPage = ReservePage(column);
RPageStorage::ColumnHandle_t GetHandleSource() const
const RColumnModel & GetModel() const
ColumnId_t GetColumnIdSource() const
RPageSource * GetPageSource() const
RPage GetPage(RColumn *column, NTupleSize_t index)
Tries to find the page corresponding to column and index in the cache.
std::vector< std::uint32_t > fReferences
void ReleasePage(const RPage &page)
Give back a page to the pool. There must not be any pointers anymore into this page.
std::vector< RPage > fPages
TODO(jblomer): should be an efficient index structure that allows.
RPagePool(std::size_t pageSize, std::size_t nPages)
RPage ReservePage(RColumn *column)
Get a new, empty page from the cache. Return a "null Page" if there is no more free space.
void CommitPage(const RPage &page)
Registers a page that has previously been acquired by ReservePage() and was meanwhile filled with con...
virtual void PopulatePage(ColumnHandle_t columnHandle, NTupleSize_t index, RPage *page)=0
Fills a page starting with index rangeStart; the corresponding column is taken from the page object.
A page is a fixed size slice of a column that is mapped into memory.
std::size_t GetElementSize() const
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.