nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
nk::ReactiveSession Class Reference

Public Member Functions

 ReactiveSession (Engine &engine)
 The engine is NOT owned; the session must outlive uses of it with that engine (workspace state is shared).
bool load (const std::string &source)
 Parse source, compute facts + DAG, run the initial FULL pass (whole-source eval — script/function semantics identical to a plain run).
void setParam (const std::string &var, Value value)
 Whole-variable parameter write (Play sliders).
void setParamElement (const std::string &var, size_t r, size_t c, Value value)
 Single-cell write (the reactive table editor).
size_t evalDirty ()
 Execute the dirty statements in source order through the per-statement seam.
bool hasDirty () const
 True when something is pending for evalDirty().
std::vector< std::vector< size_t > > detectCycles () const
 Tarjan SCCs over the dependency edges (invariant guard — expected empty while edges stay forward-only).
const DependencyGraph & graph () const
size_t statementCount () const
const std::string & lastError () const
uint64_t generation () const
 Bumped on every committed write (param/element/evalDirty) — the buffer-generation source for zero-copy array views (portion C).

Detailed Description

Definition at line 50 of file reactive_session.hpp.

Member Function Documentation

◆ evalDirty()

size_t nk::ReactiveSession::evalDirty ( )

Execute the dirty statements in source order through the per-statement seam.

Returns how many ran; on error, stops and keeps the remaining dirty set (see lastError()).

◆ generation()

uint64_t nk::ReactiveSession::generation ( ) const
inline

Bumped on every committed write (param/element/evalDirty) — the buffer-generation source for zero-copy array views (portion C).

Definition at line 92 of file reactive_session.hpp.

◆ graph()

const DependencyGraph & nk::ReactiveSession::graph ( ) const
inline

Definition at line 86 of file reactive_session.hpp.

◆ hasDirty()

bool nk::ReactiveSession::hasDirty ( ) const
inline

True when something is pending for evalDirty().

Definition at line 80 of file reactive_session.hpp.

◆ lastError()

const std::string & nk::ReactiveSession::lastError ( ) const
inline

Definition at line 88 of file reactive_session.hpp.

◆ load()

bool nk::ReactiveSession::load ( const std::string & source)

Parse source, compute facts + DAG, run the initial FULL pass (whole-source eval — script/function semantics identical to a plain run).

Returns false on parse or initial-run error (see lastError()).

◆ setParam()

void nk::ReactiveSession::setParam ( const std::string & var,
Value value )

Whole-variable parameter write (Play sliders).

Marks the dependency-dirty set; the script's own pure definitions of the variable are skipped (the param replaces them).

◆ setParamElement()

void nk::ReactiveSession::setParamElement ( const std::string & var,
size_t r,
size_t c,
Value value )

Single-cell write (the reactive table editor).

Native cell assignment via the engine; marks the ELEMENT-dirty set — only formulas whose READ regions touch (r,c) re-run.

◆ statementCount()

size_t nk::ReactiveSession::statementCount ( ) const
inline

Definition at line 87 of file reactive_session.hpp.


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