Make append buffer contiguous and update iterators

This commit is contained in:
2026-08-06 19:39:59 +01:00
parent 5722731c6a
commit 189b9ab6ca
19 changed files with 463 additions and 506 deletions
+27
View File
@@ -0,0 +1,27 @@
#pragma once
#include "../shard.h"
#include "iter.h"
#include "pch.h"
struct PetalIterator {
Direction dir;
Shard *root = nullptr;
std::vector<Shard *> stack;
Petal *petal = nullptr;
uint64_t global_offset = 0;
uint64_t last_offset = 0;
uint64_t petal_offset = 0;
uint64_t global_line = 0;
PetalIterator(Shard *r, Direction dir);
~PetalIterator() = default;
void seek_offset(uint64_t offset);
void seek_line(uint64_t offset);
bool next(const char **data, uint64_t *out_len);
uint64_t byte_offset();
private:
Petal *_next(uint64_t *offset);
};