PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
spill_curve_reader.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstdint>
6
7namespace pineforge {
8namespace metrics {
9
10/// Minimal read boundary for the private binary curve (DESIGN 3.8).
11/// The descriptor/reader owner keeps an immutable snapshot of point_count
12/// consecutive 24-byte pf_equity_point_t records alive throughout a walk.
13/// Selected snapshots contain the anchor followed by the window points.
14///
15/// read(context, index, count, output) copies EXACTLY count records beginning
16/// at index into caller-owned storage, preserving every bit, or throws.
17/// Calls are positional, may repeat/restart, and never advance a file cursor.
18/// The backing writer must flush its pending bytes before exposing a snapshot.
19/// No sink-text parsing, mapping, growing read buffer or implicit tail point.
20/// SpillCurve requests at most floor(64 KiB / sizeof(pf_equity_point_t))
21/// records, always with 0 <= index and 0 < count <= point_count - index.
22///
23/// The backing data and context are borrowed; SpillCurve copies the three
24/// fields, not the backing data. A null callback is allowed only for an empty
25/// snapshot. Readers may throw std::system_error for I/O failures; failures
26/// propagate without publishing a partially filled cache. Concurrent use of
27/// one SpillCurve needs external synchronization; separate sources may share
28/// immutable backing storage.
30 using Read = void (*)(const void* context, std::int64_t index,
31 std::int64_t count, pf_equity_point_t* output);
32
33 const void* context = nullptr;
34 std::int64_t point_count = 0;
35 Read read = nullptr;
36};
37
38} // namespace metrics
39} // namespace pineforge
Single per-script-bar equity point.
Definition pineforge.h:326
Minimal read boundary for the private binary curve (DESIGN 3.8).
void(*)(const void *context, std::int64_t index, std::int64_t count, pf_equity_point_t *output) Read