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
3
#include <
pineforge/pineforge.h
>
4
5
#include <cstdint>
6
7
namespace
pineforge
{
8
namespace
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.
29
struct
ScratchCurveReader
{
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
pineforge::metrics
Definition
engine.hpp:62
pineforge
Definition
array.hpp:42
pineforge.h
pf_equity_point_t
Single per-script-bar equity point.
Definition
pineforge.h:326
pineforge::metrics::ScratchCurveReader
Minimal read boundary for the private binary curve (DESIGN 3.8).
Definition
spill_curve_reader.hpp:29
pineforge::metrics::ScratchCurveReader::Read
void(*)(const void *context, std::int64_t index, std::int64_t count, pf_equity_point_t *output) Read
Definition
spill_curve_reader.hpp:30
pineforge::metrics::ScratchCurveReader::read
Read read
Definition
spill_curve_reader.hpp:35
pineforge::metrics::ScratchCurveReader::context
const void * context
Definition
spill_curve_reader.hpp:33
pineforge::metrics::ScratchCurveReader::point_count
std::int64_t point_count
Definition
spill_curve_reader.hpp:34
include
pineforge
spill_curve_reader.hpp
PineForge unreleased — Apache-2.0 —
github.com/pineforge-4pass/pineforge-engine
—
pineforge.dev