|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
Four-operation source (DESIGN 2.2:350-351; 5:1237-1262, as amended). More...
#include <native_bar_views.hpp>
Public Types | |
| using | Visitor = bool (*)(void* context, const Bar& bar) noexcept |
| Synchronous ordered callback; bar lives for this call only. | |
Public Member Functions | |
| virtual | ~NativeLowerPathSource () noexcept=default |
| virtual std::size_t | count () const =0 |
| Fixed lifetime row count, including zero (required change 7). | |
| virtual bool | for_each (Visitor visitor, void *context) const =0 |
| Fresh whole-path walk, true only if complete and false only for visitor stop. | |
| virtual NativeBarView | segment (std::int64_t begin_ms, std::int64_t end_ms)=0 |
| Ordered contiguous rows with begin_ms <= timestamp < end_ms. | |
| virtual const Bar * | next_after_segment () const noexcept=0 |
| Null before the first segment; otherwise the first path bar at/after its end, or null at exhaustion, including for an empty segment. | |
Four-operation source (DESIGN 2.2:350-351; 5:1237-1262, as amended).
Null source means owned-vector fallback; a nonnull source is present even when count() == 0. The consumer exclusively owns the provider from applied configure to detachment at public run exit. Immutable borrowed input lives through that exit; destruction must not read it. Calls are serialized, with no concurrent/reentrant walks. Concrete factories/policy/storage stay L16's. Every operation exposes the same complete logical path. Whole-input fallback is decided before emitting any aggregated prefix; no mixed prefix/suffix.
Definition at line 151 of file native_bar_views.hpp.
| using pineforge::native_bar_views_v1::NativeLowerPathSource::Visitor = bool (*)(void* context, const Bar& bar) noexcept |
Synchronous ordered callback; bar lives for this call only.
true continues, false stops normally. Context may be null; callback is neither retained nor allowed to throw.
Definition at line 156 of file native_bar_views.hpp.
|
virtualdefaultnoexcept |
|
pure virtual |
Fixed lifetime row count, including zero (required change 7).
The first call may walk or use the construction pre-scan; subsequent calls return the cached scalar in O(1). No segment/look-ahead invalidation. Operational failure throws. Overflow throws coded std::overflow_error, run_options_rejected with option intrabar_path, never a wrapped count.
References count().
Referenced by count().
|
pure virtual |
Fresh whole-path walk, true only if complete and false only for visitor stop.
Null visitor is coded engine_invariant / std::logic_error. Source failures throw. Never overwrite active segment/look-ahead, including when a digest is read inside a callback.
References for_each().
Referenced by for_each().
|
pure virtual |
Ordered contiguous rows with begin_ms <= timestamp < end_ms.
Equal bounds give an empty view; reversed bounds are coded engine_invariant / std::logic_error. Each bound is non-decreasing across calls; windows may repeat OR overlap, including overlap rows. A decreasing bound is the same invariant error (required change 6). Repeats return the same active storage. Replace a window only after its script bar finishes. Prepare look-ahead here; failures expose no partial new segment.
References segment().
Referenced by segment().
|
pure virtualnoexcept |
Null before the first segment; otherwise the first path bar at/after its end, or null at exhaustion, including for an empty segment.
The separate one-bar buffer stays fixed until a different segment is selected. It may skip multiple empty chart bars; repeated queries do not advance or overwrite the active segment. Within a segment, use its next contiguous row; only the last row needs this look-ahead.
References next_after_segment().
Referenced by next_after_segment().