160 void edges(
Id, std::uint64_t first,
Id* out, std::size_t count)
const;
168 void read(
Id, std::uint64_t off,
void* dst, std::size_t bytes)
const;
169 void write(
Id, std::uint64_t off,
const void* src, std::size_t bytes);
178 static_assert(std::is_trivially_copyable_v<T>,
"generated scalar encoding");
185 static_assert(std::is_trivially_copyable_v<T>,
"generated scalar encoding");
193 std::unique_ptr<Tx>
begin() {
return store_.begin(); }
207 std::uint64_t type = 0;
208 std::uint64_t flags = 0;
209 std::uint64_t payload_bytes = 0;
210 std::uint64_t edge_count = 0;
214 static_assert(
sizeof(Control) == 8 &&
sizeof(Node) == 72,
"fixed graph records");
215 static_assert(std::is_trivially_copyable_v<Node>,
"records are stored as bytes");
216 static constexpr std::uint64_t kRoot = 1;
217 static constexpr std::uint64_t kRegistered = 2;
218 static constexpr std::uint64_t kMarked = 4;
220 [[noreturn]]
static void fail(
const char*);
221 static std::uint64_t edge_bytes(std::uint64_t count);
222 static std::uint64_t object_bytes(std::uint64_t payload_bytes, std::uint64_t
edge_count);
223 static std::uint64_t edges_offset(
const Node& n) {
return sizeof(Node) + n.payload_bytes; }
224 static void check_range(std::uint64_t size, std::uint64_t off, std::size_t bytes,
228 T get(
Id object, std::uint64_t off = 0)
const {
230 read_exact(
object, off, &
value,
sizeof(
value));
234 void put(
Id object,
const T&
value, std::uint64_t off = 0) {
235 write_exact(
object, off, &
value,
sizeof(
value));
237 void read_exact(
Id object, std::uint64_t off,
void* dst, std::uint64_t bytes)
const;
238 void write_exact(
Id object, std::uint64_t off,
const void* src, std::uint64_t bytes);
239 void move_bytes(
Id object, std::uint64_t from, std::uint64_t to, std::uint64_t bytes);
240 void zero_bytes(
Id object, std::uint64_t off, std::uint64_t bytes);
241 void copy_region(
Id from,
Id to, std::uint64_t off, std::uint64_t bytes);
243 bool read_node(
Id, Node&)
const;
245 void validate_child(
Id)
const;
246 Id make_node(
const UdtType&,
const void* payload,
const Id* children, std::uint64_t flags);
247 Id clone_node(
const Node&);