#include <configurationdatabase.h>
Configuration database functions.
|
static MAXON_METHOD Result< void > | QueryBool (const String &key, Bool &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state) |
|
static MAXON_METHOD Result< void > | QueryInt (const String &key, Int &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state) |
|
static MAXON_METHOD Result< void > | QueryFloat (const String &key, Float &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state) |
|
static MAXON_METHOD Result< void > | QueryString (const String &key, String &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state) |
|
static MAXON_METHOD Result< void > | AddHelpForBool (const String &key, Bool defaultValue, CONFIGURATION_CATEGORY category, const Char *help) |
|
static MAXON_METHOD Result< void > | AddHelpForInt (const String &key, Int defaultValue, Int minValue, Int maxValue, CONFIGURATION_CATEGORY category, const Char *help) |
|
static MAXON_METHOD Result< void > | AddHelpForFloat (const String &key, Float defaultValue, Float minValue, Float maxValue, CONFIGURATION_CATEGORY category, const Char *help) |
|
static MAXON_METHOD Result< void > | AddHelpForString (const String &key, const String &defaultValue, CONFIGURATION_CATEGORY category, const Char *help) |
|
static MAXON_METHOD Result< void > | AddHelpForOption (const String &key, const String &option, Bool isDefaultValue, Bool caseSensitive, CONFIGURATION_CATEGORY category, const Char *help) |
|
static MAXON_METHOD Result< void > | BroadcastBool (const String &key, Bool value) |
|
static MAXON_METHOD Result< void > | BroadcastInt (const String &key, Int value) |
|
static MAXON_METHOD Result< void > | BroadcastFloat (const String &key, Float value) |
|
static MAXON_METHOD Result< void > | BroadcastString (const String &key, const String &value) |
|
◆ MAXON_INTERFACE_NONVIRTUAL()
◆ QueryBool()
Retrieves a boolean value from the configuration database. If an entry is not present the function will return an error. If an entry is present but its state is invalid the function will also return an error and set 'state' to CONFIGURATIONENTRY_STATE::INVALID. In that case you can use GetConfigurationDatabaseString to retrieve the text content of the entry.
Sample code showing correct usage:
Bool g_show_cells =
true;
static MAXON_METHOD Result< void > QueryBool(const String &key, Bool &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state)
PyArena _PyASTOptimizeState * state
Definition: compile.h:99
PyObject PyObject * result
Definition: abstract.h:43
maxon::Bool Bool
Definition: ge_sys_math.h:55
#define ifnoerr(...)
The opposite of iferr.
Definition: errorbase.h:393
CONFIGURATIONENTRY_ORIGIN
Source where a configuration value was defined.
Definition: configuration.h:27
CONFIGURATIONENTRY_STATE
State of a configuration value.
Definition: configuration.h:36
- Parameters
-
[in] | key | Key that is searched in the database. |
[out] | result | Value of the database entry if valid or false. |
[out] | origin | Documents where the database entry was defined. |
[out] | state | State of the database entry. |
- Returns
- IllegalArgumentError if there is no entry in the database or its value is invalid.
◆ QueryInt()
Retrieves an integer value from the configuration database. If an entry is not present the function will return an error. If an entry is present but its state is invalid the function will also return an error and set 'state' to CONFIGURATIONENTRY_STATE::INVALID. In that case you can use GetConfigurationDatabaseString to retrieve the text content of the entry.
Sample code showing correct usage:
static MAXON_METHOD Result< void > QueryInt(const String &key, Int &result, CONFIGURATIONENTRY_ORIGIN &origin, CONFIGURATIONENTRY_STATE &state)
maxon::Int Int
Definition: ge_sys_math.h:64
- Parameters
-
[in] | key | Key that is searched in the database. |
[out] | result | Value of the database entry if valid or 0. |
[out] | origin | Documents where the database entry was defined. |
[out] | state | State of the database entry. |
- Returns
- IllegalArgumentError if there is no entry in the database or its value is invalid.
◆ QueryFloat()
Retrieves a floating point value from the configuration database. If an entry is not present the function will return an error. If an entry is present but its state is invalid the function will also return an error and set 'state' to CONFIGURATIONENTRY_STATE::INVALID. In that case you can use GetConfigurationDatabaseString to retrieve the text content of the entry.
Sample code showing correct usage:
- Parameters
-
[in] | key | Key that is searched in the database. |
[out] | result | Value of the database entry if valid or 0.0. |
[out] | origin | Documents where the database entry was defined. |
[out] | state | State of the database entry. |
- Returns
- IllegalArgumentError if there is no entry in the database or its value is invalid.
◆ QueryString()
Retrieves a string from the configuration database. This function can also be called on any boolean, integer or floating point types as all values are stored as strings in the database. If an entry is not present the function will return an error.
Sample code showing correct usage:
Int g_cellName =
"unknown"_s;
- Parameters
-
[in] | key | Key that is searched in the database. |
[out] | result | Value of the database entry or an empty string if not present. |
[out] | origin | Documents where the database entry was defined. |
[out] | state | State of the database entry. |
- Returns
- IllegalArgumentError if there is no entry in the database.
◆ AddHelpForBool()
Adds information to the help system (command line option 'help') and marks an entry in the configuration database as used (or invalid). This is necessary so that the application won't warn that a key is unknown. This routine must only be used for values created dynamically at runtime and not if a value was created by one of the MAXON_CONFIGURATION_XXX macros.
- Parameters
-
- Returns
- OK on success.
◆ AddHelpForInt()
Adds information to the help system (command line option 'help') and marks an entry in the configuration database as used (or invalid / out of range). This is necessary so that the application won't warn that a key is unknown. This routine must only be used for values created dynamically at runtime and not if a value was created by one of the MAXON_CONFIGURATION_XXX macros.
- Parameters
-
[in] | key | Key that is processed. |
[in] | defaultValue | Default value that will show up in the help information. |
[in] | minValue | The smallest allowed value. |
[in] | maxValue | The largest allowed value. |
[in] | category | The help category (should usually be set to either CONFIGURATION_CATEGORY::REGULAR or CONFIGURATION_CATEGORY::DEVELOPMENT). |
[in] | help | Help text as a C string. |
- Returns
- OK on success.
◆ AddHelpForFloat()
Adds information to the help system (command line option 'help') and marks an entry in the configuration database as used (or invalid / out of range). This is necessary so that the application won't warn that a key is unknown. This routine must only be used for values created dynamically at runtime and not if a value was created by one of the MAXON_CONFIGURATION_XXX macros.
- Parameters
-
[in] | key | Key that is processed. |
[in] | defaultValue | Default value that will show up in the help information. |
[in] | minValue | The smallest allowed value. |
[in] | maxValue | The largest allowed value. |
[in] | category | The help category (should usually be set to either CONFIGURATION_CATEGORY::REGULAR or CONFIGURATION_CATEGORY::DEVELOPMENT). |
[in] | help | Help text as a C string. |
- Returns
- OK on success.
◆ AddHelpForString()
Adds information to the help system (command line option 'help') and marks an entry in the configuration database as used (or invalid / out of range). This is necessary so that the application won't warn that a key is unknown. This routine must only be used for values created dynamically at runtime and not if a value was created by one of the MAXON_CONFIGURATION_XXX macros.
- Parameters
-
- Returns
- OK on success.
◆ AddHelpForOption()
Adds information to the help system (command line option 'help') and marks an entry in the configuration database as used if the passed option was set. This is necessary so that the application won't warn that a key is unknown. This routine must only be used for values created dynamically at runtime and not if a value was created by one of the MAXON_CONFIGURATION_XXX macros. Call this routine multiple times to add all available options. category and help should be the same for each call. Example: three calls with option set to "a", "b" and then "c" will create the help text description key=[a|b|c]
- Parameters
-
[in] | key | Key that is processed. |
[in] | option | Option that the key is checked for. |
[in] | isDefaultValue | Determines if the passed option is the default value. |
[in] | caseSensitive | If true the corresponding entry in the database will only be flagged if the case-sensitive comparison is successful. |
[in] | category | The help category (should usually be set to either CONFIGURATION_CATEGORY::REGULAR or CONFIGURATION_CATEGORY::DEVELOPMENT). |
[in] | help | Help text as a C string. |
- Returns
- OK on success.
◆ BroadcastBool()
Copies a value into all modules that defined it. E.g. in case of a crash situation g_inCrashhandler can be set to true with this routine.
- Parameters
-
[in] | key | Case-Sensitive key that is processed. |
[in] | value | Value to be set. |
- Returns
- OK on success. A possible result value is IllegalArgumentError if the key did not exist.
◆ BroadcastInt()
Copies a value into all modules that defined it. E.g. in case of a crash situation g_inCrashhandler can be set to true with this routine.
- Parameters
-
[in] | key | Case-Sensitive key that is processed. |
[in] | value | Value to be set. |
- Returns
- OK on success. A possible result value is IllegalArgumentError if the key did not exist.
◆ BroadcastFloat()
Copies a value into all modules that defined it. E.g. in case of a crash situation g_inCrashhandler can be set to true with this routine.
- Parameters
-
[in] | key | Case-Sensitive key that is processed. |
[in] | value | Value to be set. |
- Returns
- OK on success. A possible result value is IllegalArgumentError if the key did not exist.
◆ BroadcastString()
Copies a value into all modules that defined it. E.g. in case of a crash situation g_inCrashhandler can be set to true with this routine.
- Parameters
-
[in] | key | Case-Sensitive key that is processed. |
[in] | value | Value to be set. |
- Returns
- OK on success. A possible result value is IllegalArgumentError if the key did not exist.