Handling of data in parameter sets. More...

Functions | |
| void | GfParmRemove (void *parmHandle, char *sectionName, char *paramName) |
| Remove a parameter from a parameter set. | |
| tdble | GfParmUnit2SI (const char *unit, tdble val) |
| Convert a value given in unit to SI. | |
| tdble | GfParmSI2Unit (const char *unit, tdble val) |
| Convert a value from SI to given unit. | |
| char * | GfParmGetName (void *handle) |
| Get the name property of the parameter set handle. | |
| const char * | GfParmGetStr (void *parmHandle, const char *path, const char *key, const char *deflt) |
| Get a string parameter from the parameter set handle. | |
| tdble | GfParmGetNum (void *handle, const char *path, const char *key, const char *unit, tdble deflt) |
| Get a numerical parameter from the parameter set handle. | |
| int | GfParmSetStr (void *handle, const char *path, const char *key, const char *val) |
| Set a string parameter in the parameter set handle. | |
| int | GfParmSetNum (void *handle, const char *path, const char *key, const char *unit, tdble val) |
| Set a numerical parameter in the parameter set handle. | |
| int | GfParmSetNumEx (void *handle, const char *path, const char *key, const char *unit, tdble val, tdble min, tdble max) |
| Set a numerical parameter and its bounds, creating it if necessary. | |
| int | GfParmGetNumBoundaries (void *handle, const char *path, const char *key, tdble *min, tdble *max) |
| Get the min and max of a numerical parameter from the parameter set handle. | |
Handling of data in parameter sets.
| char * GfParmGetName | ( | void * | handle | ) |
Get the name property of the parameter set handle.
| [in] | handle | parameter set handle |
Definition at line 2192 of file params.cpp.

| tdble GfParmGetNum | ( | void * | handle, |
| const char * | path, | ||
| const char * | key, | ||
| const char * | unit, | ||
| tdble | deflt ) |
Get a numerical parameter from the parameter set handle.
If the parameter does not exist the given default value is returned without unit conversion.
| [in] | handle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [in] | unit | unit to convert the result to (NULL if SI is desired) |
| [in] | deflt | Fallback value already expressed in the requested unit. |
Definition at line 2534 of file params.cpp.

| int GfParmGetNumBoundaries | ( | void * | handle, |
| const char * | path, | ||
| const char * | key, | ||
| tdble * | min, | ||
| tdble * | max ) |
Get the min and max of a numerical parameter from the parameter set handle.
| [in] | handle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [out] | min | Non-NULL destination for the minimum in SI units. |
| [out] | max | Non-NULL destination for the maximum in SI units. |
Definition at line 3268 of file params.cpp.

| const char * GfParmGetStr | ( | void * | parmHandle, |
| const char * | path, | ||
| const char * | key, | ||
| const char * | deflt ) |
Get a string parameter from the parameter set handle.
If the parameter does not yet exist the given default is returned.
| [in] | parmHandle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [in] | deflt | Borrowed fallback string, possibly NULL. |
Definition at line 2453 of file params.cpp.

| void GfParmRemove | ( | void * | parmHandle, |
| char * | sectionName, | ||
| char * | paramName ) |
Remove a parameter from a parameter set.
Not declared in the public tgf.h API. Public callers can remove an attribute with GfParmSetStr(handle, path, key, NULL), including a numeric attribute.
| [in,out] | parmHandle | Parameter set to modify. |
| [in] | sectionName | Section path. |
| [in] | paramName | Parameter name. Empty sections and their empty ancestors are pruned after removal (also when the attribute was already absent). |
Definition at line 1829 of file params.cpp.

| int GfParmSetNum | ( | void * | handle, |
| const char * | path, | ||
| const char * | key, | ||
| const char * | unit, | ||
| tdble | val ) |
Set a numerical parameter in the parameter set handle.
If the parameter does not yet exist it is created. The value is assigned to the value, min and max.
| [in,out] | handle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [in] | unit | Unit of the supplied value (NULL or empty for SI); copied for later serialization. The value is converted to SI for storage. |
| [in] | val | value to set |
Definition at line 2737 of file params.cpp.

| int GfParmSetNumEx | ( | void * | handle, |
| const char * | path, | ||
| const char * | key, | ||
| const char * | unit, | ||
| tdble | val, | ||
| tdble | min, | ||
| tdble | max ) |
Set a numerical parameter and its bounds, creating it if necessary.
Replaces the existing type, value and bounds. Does not validate min <= max or clamp val into that range; callers must supply consistent values.
| [in,out] | handle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [in] | unit | Unit of val, min and max (NULL or empty for SI). All three are converted to SI; a copy of the unit is retained for serialization. |
| [in] | val | value to set |
| [in] | min | min value to set |
| [in] | max | max value to set |
Definition at line 2783 of file params.cpp.

| int GfParmSetStr | ( | void * | handle, |
| const char * | path, | ||
| const char * | key, | ||
| const char * | val ) |
Set a string parameter in the parameter set handle.
Creates missing sections and the attribute, or replaces its value/type. Copies val; the string's within constraint is not checked. NULL or empty val removes the attribute and prunes empty sections/ancestors instead. Copy a borrowed value before passing it back to a setter for the same attribute, which frees the old storage first.
| [in,out] | handle | parameter set handle |
| [in] | path | path of the parameter |
| [in] | key | parameter key name |
| [in] | val | String to copy (NULL or empty to remove the attribute). |
Definition at line 2623 of file params.cpp.

Convert a value from SI to given unit.
| [in] | unit | Unit expression to convert to; NULL or empty leaves val unchanged. |
| [in] | val | value in SI units to be converted to unit |
Definition at line 2133 of file params.cpp.

Convert a value given in unit to SI.
The units can be combined with "/", "." and "2" (square), e.g. "lbf/in", "N.m", "kg.m/s2". After the first slash, all remaining factors are denominator factors, including those separated by dots. There is no dimensional validation: unknown tokens have conversion factor 1.
| [in] | unit | Unit expression for val; NULL or empty leaves val unchanged. Tokens are case-sensitive except for explicitly listed aliases and must fit in the internal 256-byte token buffer, including its terminator. |
| [in] | val | value in unit |
Definition at line 2079 of file params.cpp.
