Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::OhlcBucket Class Reference

Constant-storage domain aggregation, performed before display snapshot coalescing. One producer owns mutation; copy value() into immutable provider storage before publishing. No allocation, I/O or UI affinity. Caller chooses bucket boundaries and tick ordering. More...

#include <chart.hpp>

Public Member Functions

bool add (double price) noexcept
 Add an ordered price tick without dropping its effect.
std::optional< Ohlc > value () const noexcept
 Copy the current aggregate.
void reset () noexcept
 Begin the next caller-defined bucket; no queued or published state is affected.

Detailed Description

Constant-storage domain aggregation, performed before display snapshot coalescing. One producer owns mutation; copy value() into immutable provider storage before publishing. No allocation, I/O or UI affinity. Caller chooses bucket boundaries and tick ordering.

Member Function Documentation

◆ add()

bool portals::OhlcBucket::add ( double price)
noexcept

Add an ordered price tick without dropping its effect.

Parameters
priceFinite domain price; NaN/infinity are explicitly rejected.
Returns
True when included; false leaves the aggregate unchanged.

◆ value()

std::optional< Ohlc > portals::OhlcBucket::value ( ) const
noexcept

Copy the current aggregate.

Returns
Empty before the first finite tick, otherwise an independent OHLC value.

The documentation for this class was generated from the following file: