welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::sol2::rod::_enum_binding< E > Struct Template Reference

A welded enum's binding: the name→value table, how to mirror a name onto the enclosing scope, and whether the enum is scoped (an unscoped enum also mirrors its names onto the enclosing scope, like C++). More...

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

Public Attributes

::sol::table values
 The E = { Name = value, … } table.
std::function< void(const char *, lua_Integer)> mirror
 Write one name onto the enclosing scope.
bool scoped
 true for enum class.

Detailed Description

template<class E>
struct welder::rods::sol2::rod::_enum_binding< E >

A welded enum's binding: the name→value table, how to mirror a name onto the enclosing scope, and whether the enum is scoped (an unscoped enum also mirrors its names onto the enclosing scope, like C++).

The mirror is a closure rather than a table because the enclosing scope differs in kind: a module is a plain sol::table, but a class-nested enum's scope is the outer's sol::usertype — whose static entries write through sol2's usertype storage, not plain table sets.

Definition at line 164 of file rod.hpp.

Member Data Documentation

◆ mirror

template<class E>
std::function<void(const char*, lua_Integer)> welder::rods::sol2::rod::_enum_binding< E >::mirror

Write one name onto the enclosing scope.

Definition at line 167 of file rod.hpp.

◆ scoped

template<class E>
bool welder::rods::sol2::rod::_enum_binding< E >::scoped

true for enum class.

Definition at line 168 of file rod.hpp.

◆ values

template<class E>
::sol::table welder::rods::sol2::rod::_enum_binding< E >::values

The E = { Name = value, … } table.

Definition at line 165 of file rod.hpp.


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