Registry of live constants — thread-safe singleton.
More...
#include <live_constant_editor.hpp>
|
| float & | register_constant (std::string_view name, std::string_view file, int line, float default_value, float min_val, float max_val) |
| | Register a constant. Returns a reference to the stored value.
|
| std::vector< LiveConstant > | all () const |
| | Get all registered constants.
|
| void | reset_all () |
| | Reset all constants to defaults.
|
| void | reset (std::string_view name) |
| | Reset a specific constant.
|
| void | set (std::string_view name, float value) |
| | Set a constant value by name.
|
| float | get (std::string_view name) const |
| | Get a constant value by name.
|
| int | count () const |
| | Number of registered constants.
|
|
| static LiveConstantRegistry & | instance () |
Registry of live constants — thread-safe singleton.
◆ all()
| std::vector< LiveConstant > pulp::view::LiveConstantRegistry::all |
( |
| ) |
const |
Get all registered constants.
◆ count()
| int pulp::view::LiveConstantRegistry::count |
( |
| ) |
const |
Number of registered constants.
◆ get()
| float pulp::view::LiveConstantRegistry::get |
( |
std::string_view | name | ) |
const |
Get a constant value by name.
◆ instance()
| LiveConstantRegistry & pulp::view::LiveConstantRegistry::instance |
( |
| ) |
|
|
static |
◆ register_constant()
| float & pulp::view::LiveConstantRegistry::register_constant |
( |
std::string_view | name, |
|
|
std::string_view | file, |
|
|
int | line, |
|
|
float | default_value, |
|
|
float | min_val, |
|
|
float | max_val ) |
Register a constant. Returns a reference to the stored value.
◆ reset()
| void pulp::view::LiveConstantRegistry::reset |
( |
std::string_view | name | ) |
|
Reset a specific constant.
◆ reset_all()
| void pulp::view::LiveConstantRegistry::reset_all |
( |
| ) |
|
Reset all constants to defaults.
◆ set()
| void pulp::view::LiveConstantRegistry::set |
( |
std::string_view | name, |
|
|
float | value ) |
Set a constant value by name.
◆ on_change
| std::function<void(const LiveConstant&)> pulp::view::LiveConstantRegistry::on_change |
Called when any constant changes.
The documentation for this class was generated from the following file: