TimelineLifespans.h header
#include <ew/app/TimelineLifespans.h>
Namespace ew::app
LifespanBar struct
struct ew::app::LifespanBar
A lifespan drawn as a bar on the timeline (TL-63): born-to-died, a reign, a tenure. start is the birth; end is the death, or equals start when openEnded (still alive, or a death recorded before the birth – a data slip the bar shows as open rather than inverted, so the axis never lies about direction). The desktop draws an open-ended bar running to the view's right edge.
Members
ew::core::ContentId ew::app::LifespanBar::entityId
The entity this lifespan belongs to (for navigation back to it).
QString ew::app::LifespanBar::name
The entity's display name – the bar's label.
qint64 ew::app::LifespanBar::start = 0
The bar's start instant: the birth.
qint64 ew::app::LifespanBar::end = 0
The bar's end instant: the death, or equals start when openEnded.
bool ew::app::LifespanBar::openEnded = false
True when still alive (or a death before birth): the bar runs to the view edge.
bool operator==(const LifespanBar &, const LifespanBar &)=default
Value equality over all fields, for testing.
LifespanInput struct
struct ew::app::LifespanInput
One entity's lifespan facts, as the timeline needs them to draw a "who was alive then" bar (TL-63). Gathered from the codex (and mounted libraries) by the desktop; kept a plain value so the bar maths stays pure and testable.
Members
ew::core::ContentId ew::app::LifespanInput::id
The entity the lifespan belongs to (so a bar can navigate back to it).
QString ew::app::LifespanInput::name
The entity's display name – the bar's label.
std::optional<qint64> ew::app::LifespanInput::birth
Birth instant (minutes since the story epoch), if known. An entity with no birth has no lifespan bar: there is nothing to place on the axis.
std::optional<qint64> ew::app::LifespanInput::death
Death instant, if known. Absent means still alive at the end of the story – an open-ended bar.
Functions
std::vector< LifespanBar > ew::app::lifespanBars(const std::vector< LifespanInput > &inputs)
The lifespan bars for inputs (TL-63), earliest birth first so the lane reads top-to-bottom in chronological order. An input with no birth is skipped (nothing to place). A death at or after the birth gives a closed [birth, death] bar; a missing death, or a death BEFORE the birth, gives an open-ended bar starting at the birth – the timeline then runs it to the view edge. Pure.