welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::sol2::rod::session Struct Reference

Per-module session: the deferred state for live namespace variables. More...

#include <welder/rods/lua/sol2/rod.hpp>

Public Attributes

::sol::table getters {}
 name → fun(): value (live reads).
::sol::table setters {}
 name → fun(value) (live writes).
bool has_live {false}
 any mutable variable registered?

Detailed Description

Per-module session: the deferred state for live namespace variables.

A mutable variable is not stored on the module table directly; instead its name → getter/name → setter closures accumulate here, and close_module installs a __index/__newindex metatable proxy that routes reads/writes of those absent keys through them (see add_variable). getters/setters stay nil (default-constructed) until the first mutable variable, so a module with only snapshots or types pays nothing. Const variables never reach here — they snapshot as plain table entries.

Definition at line 116 of file rod.hpp.

Member Data Documentation

◆ getters

::sol::table welder::rods::sol2::rod::session::getters {}

name → fun(): value (live reads).

Definition at line 117 of file rod.hpp.

Referenced by welder::rods::sol2::rod::add_variable(), and welder::rods::sol2::rod::close_module().

◆ has_live

bool welder::rods::sol2::rod::session::has_live {false}

any mutable variable registered?

Definition at line 119 of file rod.hpp.

Referenced by welder::rods::sol2::rod::add_variable(), and welder::rods::sol2::rod::close_module().

◆ setters

::sol::table welder::rods::sol2::rod::session::setters {}

name → fun(value) (live writes).

Definition at line 118 of file rod.hpp.

Referenced by welder::rods::sol2::rod::add_variable(), and welder::rods::sol2::rod::close_module().


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