|
ReXGlue SDK
|
#include <rex/setting.h>
Public Member Functions | |
| template<typename... Traits> | |
| Setting (SettingOwner *owner, std::string_view name, const T &default_value, std::string_view help, Traits... traits) | |
| T | Get () const |
| Result< void > | Set (const T &value) |
| Result< void > | Lock (const T &value) |
| ScopeGuard | OnChange (MoveOnlyFunction< void(const T &)> fn) |
| Public Member Functions inherited from rex::SettingBase | |
| const std::string & | GetName () const |
| const std::string & | GetHelp () const |
| SettingType | GetType () const |
| const SettingConstraints & | GetConstraints () const |
| SettingOwner & | GetOwner () const |
| SettingLayer | GetLayer () const |
| bool | IsFrozen () const |
| bool | IsRestartPending () const |
| std::string | GetText () const |
| std::string | GetDefaultText () const |
| Result< void > | Check (std::string_view text) const |
| Result< void > | SetText (SettingLayer layer, std::string_view text) |
| Result< void > | Reset () |
Additional Inherited Members | |
| Protected Member Functions inherited from rex::SettingBase | |
| SettingBase (SettingOwner &owner, std::string_view name, SettingType type, std::string_view help) | |
| SettingConstraints & | EditConstraints () |
| Result< void > | SetFromCode (std::string_view text) |
| Protected Member Functions inherited from rex::NonCopyable | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
A typed setting, declared with REX_SETTING inside its owner. Scalars read lock free.
| T | bool, i32, i64, u32, u64, f64, std::string or std::filesystem::path. |
| rex::Setting< T >::Setting | ( | SettingOwner * | owner, |
| std::string_view | name, | ||
| const T & | default_value, | ||
| std::string_view | help, | ||
| Traits... | traits ) |
| T rex::Setting< T >::Get | ( | ) | const |
Returns the value. A path comes back with its {scope.name} references resolved.
|
nodiscard |
Stores a value at the lock layer, so no later layer changes it.
|
nodiscard |
Calls a function after every change, on the thread that made it.
| fn | Called with the new value. |
|
nodiscard |
Stores a value at the title layer before launch, the runtime layer after.