class
TConfigVariable
template<typename T>Represents a globally accessible variable that can be configured from command line, config files, or at runtime.
Template parameters
T | The value type (bool, i32, u32, or float). |
|---|
Public
Constructors
TConfigVariable<T>
Creates a new configuration variable and registers it with the manager.
- name
- The unique name for this variable (e.g., "render.vsync").
- description
- A human-readable description of what this variable controls.
- defaultValue
- The default value if not set from config or command line.
- flags
- Optional flags controlling behavior (RenderThreadSafe, ReadOnly).
TConfigVariable
Creates a new configuration variable and registers it with the manager.
- name
- The unique name for this variable (e.g., "render.vsync").
- description
- A human-readable description of what this variable controls.
- defaultValue
- The default value if not set from config or command line.
- flags
- Optional flags controlling behavior (RenderThreadSafe, ReadOnly).
TConfigVariable
Creates a new configuration variable and registers it with the manager.
- name
- The unique name for this variable (e.g., "render.vsync").
- description
- A human-readable description of what this variable controls.
- defaultValue
- The default value if not set from config or command line.
- flags
- Optional flags controlling behavior (RenderThreadSafe, ReadOnly).
TConfigVariable
Creates a new configuration variable and registers it with the manager.
- name
- The unique name for this variable (e.g., "render.vsync").
- description
- A human-readable description of what this variable controls.
- defaultValue
- The default value if not set from config or command line.
- flags
- Optional flags controlling behavior (RenderThreadSafe, ReadOnly).
TConfigVariable
Creates a new configuration variable and registers it with the manager.
- name
- The unique name for this variable (e.g., "render.vsync").
- description
- A human-readable description of what this variable controls.
- defaultValue
- The default value if not set from config or command line.
- flags
- Optional flags controlling behavior (RenderThreadSafe, ReadOnly).
Methods
~TConfigVariable<T>
Get
Returns the current value.
This is always a simple atomic load with no branching, fast to access.
GetDefault
Returns the default value that was specified at construction.
Set
Sets a new value at runtime.
- value
- The new value to set.
Returns: True if the value was set, false if the variable is ReadOnly.
GetValueAsString
Returns the current value formatted as a string.
GetDefaultValueAsString
Returns the default value formatted as a string.
GetTypeName
Returns the type name of this variable (e.g., "bool", "i32").
~TConfigVariable
Get
Returns the current value.
This is always a simple atomic load with no branching, fast to access.
GetDefault
Returns the default value that was specified at construction.
Set
Sets a new value at runtime.
- value
- The new value to set.
Returns: True if the value was set, false if the variable is ReadOnly.
GetValueAsString
Returns the current value formatted as a string.
GetDefaultValueAsString
Returns the default value formatted as a string.
GetTypeName
Returns the type name of this variable (e.g., "bool", "i32").
~TConfigVariable
Get
Returns the current value.
This is always a simple atomic load with no branching, fast to access.
GetDefault
Returns the default value that was specified at construction.
Set
Sets a new value at runtime.
- value
- The new value to set.
Returns: True if the value was set, false if the variable is ReadOnly.
GetValueAsString
Returns the current value formatted as a string.
GetDefaultValueAsString
Returns the default value formatted as a string.
GetTypeName
Returns the type name of this variable (e.g., "bool", "i32").
~TConfigVariable
Get
Returns the current value.
This is always a simple atomic load with no branching, fast to access.
GetDefault
Returns the default value that was specified at construction.
Set
Sets a new value at runtime.
- value
- The new value to set.
Returns: True if the value was set, false if the variable is ReadOnly.
GetValueAsString
Returns the current value formatted as a string.
GetDefaultValueAsString
Returns the default value formatted as a string.
GetTypeName
Returns the type name of this variable (e.g., "bool", "i32").
~TConfigVariable
Get
Returns the current value.
This is always a simple atomic load with no branching, fast to access.
GetDefault
Returns the default value that was specified at construction.
Set
Sets a new value at runtime.
- value
- The new value to set.
Returns: True if the value was set, false if the variable is ReadOnly.
GetValueAsString
Returns the current value formatted as a string.
GetDefaultValueAsString
Returns the default value formatted as a string.
GetTypeName
Returns the type name of this variable (e.g., "bool", "i32").
Operators
operator type-parameter-0-0
Implicit conversion to the value type for convenient usage.
operator bool
Implicit conversion to the value type for convenient usage.
operator int
Implicit conversion to the value type for convenient usage.
operator unsigned int
Implicit conversion to the value type for convenient usage.
operator float
Implicit conversion to the value type for convenient usage.
Private
Methods
ApplyPendingUpdate
Called by ConfigVariableManager to apply any pending deferred updates.
SetFromString
Sets the value from a string representation.
- value
- The string value to parse.
- source
- The source of this value (for priority handling).
Returns: True if the value was successfully set, false otherwise.
SetValueWithoutChecks
Internal method to set the value, bypassing ReadOnly checks.
Used during initialization from config file or command line.
ApplyPendingUpdate
Called by ConfigVariableManager to apply any pending deferred updates.
SetFromString
Sets the value from a string representation.
- value
- The string value to parse.
- source
- The source of this value (for priority handling).
Returns: True if the value was successfully set, false otherwise.
SetValueWithoutChecks
Internal method to set the value, bypassing ReadOnly checks.
Used during initialization from config file or command line.
ApplyPendingUpdate
Called by ConfigVariableManager to apply any pending deferred updates.
SetFromString
Sets the value from a string representation.
- value
- The string value to parse.
- source
- The source of this value (for priority handling).
Returns: True if the value was successfully set, false otherwise.
SetValueWithoutChecks
Internal method to set the value, bypassing ReadOnly checks.
Used during initialization from config file or command line.
ApplyPendingUpdate
Called by ConfigVariableManager to apply any pending deferred updates.
SetFromString
Sets the value from a string representation.
- value
- The string value to parse.
- source
- The source of this value (for priority handling).
Returns: True if the value was successfully set, false otherwise.
SetValueWithoutChecks
Internal method to set the value, bypassing ReadOnly checks.
Used during initialization from config file or command line.
ApplyPendingUpdate
Called by ConfigVariableManager to apply any pending deferred updates.
SetFromString
Sets the value from a string representation.
- value
- The string value to parse.
- source
- The source of this value (for priority handling).
Returns: True if the value was successfully set, false otherwise.
SetValueWithoutChecks
Internal method to set the value, bypassing ReadOnly checks.
Used during initialization from config file or command line.